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

Deadlock when setting replication system variables

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 5.5.27
    • None
    • None

    Description

      There are a number of deadlock problems when setting replication system
      variables rpl_do_, rpl_ignore_, rpl_wild_*, slave_skip_counter,
      slave_net_timeout.

      The setting of these takes LOCK_active_mi (and some of them also
      active_mi->rld.run_lock) while holding LOCK_global_system_variables. But slave
      start takes these locks in the opposite order (due to THD::init() taking
      LOCK_global_system_variables).

      The fix is to temporarily unlock LOCK_global_system_variables while taking the
      replication locks.

      Thanks to Davi Arnaut for finding this bug and providing the fix:

      https://github.com/twitter/mysql/commit/be79b5405c0d6528c936733270319dab7b1e289a

      Attachments

        Activity

          knielsen Kristian Nielsen created issue -
          knielsen Kristian Nielsen made changes -
          Field Original Value New Value
          Assignee Rasmus Johansson [ ratzpo ] Kristian Nielsen [ knielsen ]
          knielsen Kristian Nielsen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          knielsen Kristian Nielsen made changes -
          Key TODO-250 MDEV-450
          Project MP todo [ 10100 ] MariaDB Development [ 10000 ]
          Workflow jira [ 13801 ] defaullt [ 13805 ]
          Issue Type Task [ 3 ] Bug [ 1 ]
          knielsen Kristian Nielsen made changes -
          Fix Version/s 5.5.27 [ 11100 ]
          Description https://github.com/twitter/mysql/commit/be79b5405c0d6528c936733270319dab7b1e289a There are a number of deadlock problems when setting replication system
          variables rpl_do_*, rpl_ignore_*, rpl_wild_*, slave_skip_counter,
          slave_net_timeout.

          The setting of these takes LOCK_active_mi (and some of them also
          active_mi->rld.run_lock) while holding LOCK_global_system_variables. But slave
          start takes these locks in the opposite order (due to THD::init() taking
          LOCK_global_system_variables).

          The fix is to temporarily unlock LOCK_global_system_variables while taking the
          replication locks.

          Thanks to Davi Arnaut for finding this bug and providing the fix:

          https://github.com/twitter/mysql/commit/be79b5405c0d6528c936733270319dab7b1e289a
          Priority Major [ 3 ] Minor [ 4 ]
          Summary Merge bugfix from Davi Deadlock when setting replication system variables

          Patch looks good, thanks Davi!

          Pushed to 5.5.

          knielsen Kristian Nielsen added a comment - Patch looks good, thanks Davi! Pushed to 5.5.
          knielsen Kristian Nielsen made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 13805 ] MariaDB v2 [ 43755 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 43755 ] MariaDB v3 [ 62935 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 62935 ] MariaDB v4 [ 144922 ]

          People

            knielsen Kristian Nielsen
            knielsen Kristian Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.