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

STOP SLAVE resets global status variables

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 5.5.36, 10.0.9
    • 5.5.37, 10.0.10
    • None
    • None

    Description

      Using mariadb-10.0.9-linux-x86_64.tar.gz.

      MariaDB [test]> show global status like 'com_insert';
      +---------------+--------+
      | Variable_name | Value  |
      +---------------+--------+
      | Com_insert    | 646298 |
      +---------------+--------+
      1 row in set (0.00 sec)
       
      MariaDB [test]> stop slave;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> show global status like 'com_insert';
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | Com_insert    | 0     |
      +---------------+-------+
      1 row in set (0.00 sec)

      Attachments

        Activity

          kolbe Kolbe Kegel (Inactive) created issue -
          kolbe Kolbe Kegel (Inactive) made changes -
          Field Original Value New Value
          Description Using mariadb-10.0.9-linux-x86_64.tar.gz.

          MariaDB [test]> show global status like 'com_insert';
          +---------------+--------+
          | Variable_name | Value |
          +---------------+--------+
          | Com_insert | 646298 |
          +---------------+--------+
          1 row in set (0.00 sec)

          MariaDB [test]> stop slave;
          Query OK, 0 rows affected (0.00 sec)

          MariaDB [test]> show global status like 'com_insert';
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | Com_insert | 0 |
          +---------------+-------+
          1 row in set (0.00 sec)
          Using mariadb-10.0.9-linux-x86_64.tar.gz.

          {noformat}
          MariaDB [test]> show global status like 'com_insert';
          +---------------+--------+
          | Variable_name | Value |
          +---------------+--------+
          | Com_insert | 646298 |
          +---------------+--------+
          1 row in set (0.00 sec)

          MariaDB [test]> stop slave;
          Query OK, 0 rows affected (0.00 sec)

          MariaDB [test]> show global status like 'com_insert';
          +---------------+-------+
          | Variable_name | Value |
          +---------------+-------+
          | Com_insert | 0 |
          +---------------+-------+
          1 row in set (0.00 sec)
          {noformat}
          elenst Elena Stepanova made changes -
          Assignee Elena Stepanova [ elenst ]

          The problem was introduced in 5.5 tree by the following revision:

          revno: 3601
          revision-id: wlad@montyprogram.com-20121220231237-0xv7egt3s225bx7j
          parent: timour@askmonty.org-20121220203840-ofoavsm70g8ouk0m
          committer: Vladislav Vaintroub <wlad@montyprogram.com>
          branch nick: 5.5
          timestamp: Fri 2012-12-21 00:12:37 +0100
          message:
            MDEV-3945 - do not hold LOCK_thread_count when freeing THD.
              
            The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory.
            This mutex  now only protects the integrity of threads list, when removing THD from it,  and thread_count variable.
              
            The add_to_status() function that updates global status during client disconnect,  is now correctly protected by the LOCK_status mutex.
            
            Benchmark : in a  "non-persistent" sysbench test (oltp_ro with reconnect after each query),  ~ 25% more connects/disconnects were measured

          I agree that the effect is bad and must be fixed, but given that it had survived for over an year without affecting anybody heavily enough to be noticed, I demote it from Blocker

          elenst Elena Stepanova added a comment - The problem was introduced in 5.5 tree by the following revision: revno: 3601 revision-id: wlad@montyprogram.com-20121220231237-0xv7egt3s225bx7j parent: timour@askmonty.org-20121220203840-ofoavsm70g8ouk0m committer: Vladislav Vaintroub <wlad@montyprogram.com> branch nick: 5.5 timestamp: Fri 2012-12-21 00:12:37 +0100 message: MDEV-3945 - do not hold LOCK_thread_count when freeing THD. The patch decreases the duration of LOCK_thread_count, so it is not hold during THD destructor and freeing memory. This mutex now only protects the integrity of threads list, when removing THD from it, and thread_count variable. The add_to_status() function that updates global status during client disconnect, is now correctly protected by the LOCK_status mutex. Benchmark : in a "non-persistent" sysbench test (oltp_ro with reconnect after each query), ~ 25% more connects/disconnects were measured I agree that the effect is bad and must be fixed, but given that it had survived for over an year without affecting anybody heavily enough to be noticed, I demote it from Blocker
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0.10 [ 14500 ]
          Fix Version/s 5.5.37 [ 15000 ]
          Affects Version/s 5.5.36 [ 14600 ]
          Assignee Elena Stepanova [ elenst ] Michael Widenius [ monty ]
          Priority Blocker [ 1 ] Critical [ 2 ]
          monty Michael Widenius made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          Problem was that global status was not updated when slave thread thd was deleted.

          Fix pushed into 5.5. Will be in 10.0.10 when we do next merge from 5.5

          monty Michael Widenius added a comment - Problem was that global status was not updated when slave thread thd was deleted. Fix pushed into 5.5. Will be in 10.0.10 when we do next merge from 5.5
          monty Michael Widenius made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow defaullt [ 36421 ] MariaDB v2 [ 43404 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 43404 ] MariaDB v3 [ 62495 ]
          knielsen Kristian Nielsen made changes -
          Comment [ The original buildbot test failure can be reproduced easily by injecting the
          following sleep in the code:
          {noformat}
          diff --git a/sql/slave.cc b/sql/slave.cc
          index 4129c4c..32e6bd4 100644
          --- a/sql/slave.cc
          +++ b/sql/slave.cc
          @@ -4837,6 +4837,7 @@ log '%s' at position %s, relay log '%s' position: %s%s", RPL_LOG_NAME,
             mysql_cond_broadcast(&rli->stop_cond);
             DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
             mysql_mutex_unlock(&rli->run_lock); // tell the world we are done
          +my_sleep(500000);
           
             /*
               Deactivate the parallel replication thread pool, if there are now no more
          {noformat}
          ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 62495 ] MariaDB v4 [ 147613 ]

          People

            monty Michael Widenius
            kolbe Kolbe Kegel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.