Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11025

Make number of page cleaner threads variable dynamic

Details

    Description

      Currently number of page cleaner threads is static variable and requires server shutdown and restart to be able to change.

      Attachments

        Issue Links

          Activity

            jplindst Jan Lindström (Inactive) added a comment - https://github.com/MariaDB/server/commit/5ecaae034e9cc829685b8cefc2533b0d353d5c3f

            I think that making parameters dynamic is a good idea.
            I requested some changes to the patch, and would like to re-review this.

            marko Marko Mäkelä added a comment - I think that making parameters dynamic is a good idea. I requested some changes to the patch, and would like to re-review this.
            jplindst Jan Lindström (Inactive) added a comment - https://github.com/MariaDB/server/commit/a3eaae42295499c242689aebfb9a5b001cdef614

            Condition variables at the moment are used only to implement os_event_t, I do not want to make this patch bigger just by introducing a new OS-dependent object (yes, I could use/copy code from os_event_t).

            jplindst Jan Lindström (Inactive) added a comment - Condition variables at the moment are used only to implement os_event_t, I do not want to make this patch bigger just by introducing a new OS-dependent object (yes, I could use/copy code from os_event_t).

            It seems that moving from events to condition variables would also require a move from InnoDB mutexes to native mutexes. OK, that would be a huge task on its own.

            The patch looks mostly OK, but it seems possible that it could introduce a hang on shutdown.

            marko Marko Mäkelä added a comment - It seems that moving from events to condition variables would also require a move from InnoDB mutexes to native mutexes. OK, that would be a huge task on its own. The patch looks mostly OK, but it seems possible that it could introduce a hang on shutdown.

            commit b23a1096956c21df037bd851494f11509b5514dd
            Author: Jan Lindström <jan.lindstrom@mariadb.com>
            Date: Sat Sep 9 11:34:12 2017 +0300

            MDEV-11025: Make number of page cleaner threads variable dynamic
            New test cases
            innodb-page-cleaners

            Modified test cases
            innodb_page_cleaners_basic

            New function buf_flush_set_page_cleaner_thread_cnt
            Increase or decrease the amount of page cleaner worker threads.
            In case of increase this function creates based on current
            abount and requested amount how many new threads should be
            created. In case of decrease this function sets up the
            requested amount of threads and uses is_requested event
            to signal workers. Then we wait until all new treads
            are started, old threads that should exit signal
            is_finished or shutdown has marked that page cleaner
            should finish.

            buf_flush_page_cleaner_worker
            Store current thread id and thread_no and then signal
            event is_finished. If number of used page cleaner threads
            decrease we shut down those threads that have thread_no
            greater or equal than number of page configured page
            cleaners - 1 (note that there will be always page cleaner
            coordinator). Before exiting we signal is_finished.

            New function innodb_page_cleaners_threads_update
            Update function for innodb-page-cleaners system variable.

            innobase_start_or_create_for_mysql
            If more than one page cleaner threads is configured
            we use new function buf_flush_set_page_cleaner_thread_cnt
            to set up the requested threads (-1 coordinator).

            jplindst Jan Lindström (Inactive) added a comment - commit b23a1096956c21df037bd851494f11509b5514dd Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Sat Sep 9 11:34:12 2017 +0300 MDEV-11025 : Make number of page cleaner threads variable dynamic New test cases innodb-page-cleaners Modified test cases innodb_page_cleaners_basic New function buf_flush_set_page_cleaner_thread_cnt Increase or decrease the amount of page cleaner worker threads. In case of increase this function creates based on current abount and requested amount how many new threads should be created. In case of decrease this function sets up the requested amount of threads and uses is_requested event to signal workers. Then we wait until all new treads are started, old threads that should exit signal is_finished or shutdown has marked that page cleaner should finish. buf_flush_page_cleaner_worker Store current thread id and thread_no and then signal event is_finished. If number of used page cleaner threads decrease we shut down those threads that have thread_no greater or equal than number of page configured page cleaners - 1 (note that there will be always page cleaner coordinator). Before exiting we signal is_finished. New function innodb_page_cleaners_threads_update Update function for innodb-page-cleaners system variable. innobase_start_or_create_for_mysql If more than one page cleaner threads is configured we use new function buf_flush_set_page_cleaner_thread_cnt to set up the requested threads (-1 coordinator).

            People

              jplindst Jan Lindström (Inactive)
              jplindst Jan Lindström (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.