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

Fix for memory write order inversion and other issues related to MW-328A

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3
    • 10.4
    • Server
    • None

    Description

      This patch fixes problems with "memory write order inversion" and
      other problems that lead to the inoperability of the MW-328A test
      from the Galera test suite. The MariaDB code contains many places
      where the values​of the variables "mysys_var->current_cond" and
      "mysys_var->current_mutex" are synchronously changed. Usually,
      the zeroing of these variables is protected by the capture of
      "mysys_var->mutex" mutex, but their initialization with non-zero
      values usually is not protected with this mutex. To avoid the
      problems caused by memory write order inversion, one of the code
      fragments (in the sql/sql_class.cc file) uses mysql_cond_broadcast
      for "mysys_var->current_cond" with additional checks and loop with
      sleep(). However, there are several other places in the MariaDB
      code where the similar broadcast is performed without additional
      checks. In addition, there are many code fragments where broadcast
      can be ignored because the enter_cond() is called after the
      "thd->killed" flag is set, but (possibly) before checking the
      "mysys_var->current_cond" variable by another thread (before
      broadcast). So I added additional checks for "thd->killed" to
      the code.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            svoj Sergey Vojtovich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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