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

InnoDB error monitor might unnecessary wait log_sys mutex

Details

    Description

      InnoDB error monitor is responsible to call every second
      sync_arr_wake_threads_if_sema_free() to wake up possible hanging threads if they are missed in mutex_signal_object.

      This is not possible if error monitor itself is on mutex/semaphore wait. We should avoid all unnecessary mutex/semaphore waits on error monitor.

      Currently error monitor calls function buf_flush_stat_update() that calls log_get_lsn() function and there we will try to get log_sys mutex. Better, solution for error monitor is that in buf_flush_stat_update() we will try to get lsn with mutex_nowait() and if we did not get mutex do not update the stats.

      Attachments

        Activity

          revno: 4347
          committer: Jan Lindström <jplindst@mariadb.org>
          branch nick: 5.5
          timestamp: Thu 2014-11-13 11:24:19 +0200
          message:
          MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex

          Analysis: InnoDB error monitor is responsible to call every second
          sync_arr_wake_threads_if_sema_free() to wake up possible hanging
          threads if they are missed in mutex_signal_object. This is not
          possible if error monitor itself is on mutex/semaphore wait. We
          should avoid all unnecessary mutex/semaphore waits on error monitor.
          Currently error monitor calls function buf_flush_stat_update()
          that calls log_get_lsn() function and there we will try to get
          log_sys mutex. Better, solution for error monitor is that in
          buf_flush_stat_update() we will try to get lsn with
          mutex_enter_nowait() and if we did not get mutex do not update
          the stats.

          Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
          function. If returned lsn is 0, we do not update flush stats.
          log_get_lsn_nowait() will use mutex_enter_nowait() and if
          we get mutex we return a correct lsn if not we return 0.

          jplindst Jan Lindström (Inactive) added a comment - revno: 4347 committer: Jan Lindström <jplindst@mariadb.org> branch nick: 5.5 timestamp: Thu 2014-11-13 11:24:19 +0200 message: MDEV-7100 : InnoDB error monitor might unnecessary wait log_sys mutex Analysis: InnoDB error monitor is responsible to call every second sync_arr_wake_threads_if_sema_free() to wake up possible hanging threads if they are missed in mutex_signal_object. This is not possible if error monitor itself is on mutex/semaphore wait. We should avoid all unnecessary mutex/semaphore waits on error monitor. Currently error monitor calls function buf_flush_stat_update() that calls log_get_lsn() function and there we will try to get log_sys mutex. Better, solution for error monitor is that in buf_flush_stat_update() we will try to get lsn with mutex_enter_nowait() and if we did not get mutex do not update the stats. Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update() function. If returned lsn is 0, we do not update flush stats. log_get_lsn_nowait() will use mutex_enter_nowait() and if we get mutex we return a correct lsn if not we return 0.

          revno: 4481
          committer: Jan Lindström <jplindst@mariadb.org>
          branch nick: 10.0-bugs
          timestamp: Thu 2014-11-13 12:00:57 +0200
          message:
          MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex

          Analysis: InnoDB error monitor is responsible to call every second
          sync_arr_wake_threads_if_sema_free() to wake up possible hanging
          threads if they are missed in mutex_signal_object. This is not
          possible if error monitor itself is on mutex/semaphore wait. We
          should avoid all unnecessary mutex/semaphore waits on error monitor.
          Currently error monitor calls function buf_flush_stat_update()
          that calls log_get_lsn() function and there we will try to get
          log_sys mutex. Better, solution for error monitor is that in
          buf_flush_stat_update() we will try to get lsn with
          mutex_enter_nowait() and if we did not get mutex do not update
          the stats.

          Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
          function. If returned lsn is 0, we do not update flush stats.
          log_get_lsn_nowait() will use mutex_enter_nowait() and if
          we get mutex we return a correct lsn if not we return 0.

          jplindst Jan Lindström (Inactive) added a comment - revno: 4481 committer: Jan Lindström <jplindst@mariadb.org> branch nick: 10.0-bugs timestamp: Thu 2014-11-13 12:00:57 +0200 message: MDEV-7100 : InnoDB error monitor might unnecessary wait log_sys mutex Analysis: InnoDB error monitor is responsible to call every second sync_arr_wake_threads_if_sema_free() to wake up possible hanging threads if they are missed in mutex_signal_object. This is not possible if error monitor itself is on mutex/semaphore wait. We should avoid all unnecessary mutex/semaphore waits on error monitor. Currently error monitor calls function buf_flush_stat_update() that calls log_get_lsn() function and there we will try to get log_sys mutex. Better, solution for error monitor is that in buf_flush_stat_update() we will try to get lsn with mutex_enter_nowait() and if we did not get mutex do not update the stats. Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update() function. If returned lsn is 0, we do not update flush stats. log_get_lsn_nowait() will use mutex_enter_nowait() and if we get mutex we return a correct lsn if not we return 0.

          People

            jplindst Jan Lindström (Inactive)
            jplindst Jan Lindström (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.