Skip to content
  • Sujatha Sivakumar's avatar
    603eaa2e
    Bug#28183718: CANNOT SHUTDOWN MYSQLD WHEN LAST BINLOG HAS · 603eaa2e
    Sujatha Sivakumar authored
    GTIDS TO SAVE AND AUTOCOMMIT=0
    
    Problem:
    =======
    When autocommit is set to 0 on GR setup, it is not possible
    to shutdown the R/O server. The message like below is
    printed forever.
    
    11:41.655154Z 0 [Note] InnoDB: Starting shutdown...
    11:41.755413Z 0 [Note] InnoDB: Dumping buffer
    pool(s) to
    12:42.453581Z 0 [Note] InnoDB: Waiting for 1 active
    transactions to finish
    
    Analysis:
    =========
    In group replication setup when single primary mode is
    enabled the secondary servers will have their
    'super_read_only=ON'. During shutdown the main server thread
    will try to save the executed gtid set in 'gtid_executed'
    table. But since the 'super_read_only' mode is enabled on
    the server the update operation fails.
    
    When AUTOCOMMIT=0 the transaction that was started while
    opening the 'gtid_executed' table doesn't complete. This
    makes the main server thread to wait indefinitely for the
    transaction to complete.
    
    When AUTOCOMMIT=1, even though update to 'gtid_executed'
    operation fails as 'super_read_only' is on,  it completes
    the active transaction. Hence shutdwon is complete but table
    is not updated.
    
    The gtid_executed table is updated upon next server restart
    as part of following code.
    
    /*
    Save unsaved GTIDs into gtid_executed table, in the following
    four cases:
      1. the upgrade case.
      2. the case that a slave is provisioned from a backup of
         the master and the slave is cleaned by RESET MASTER
         and RESET SLAVE before this.
      3. the case that no binlog rotation happened from the
         last RESET MASTER on the server before it crashes.
      4. The set of GTIDs of the last binlog is not saved into
      the gtid_executed table if server crashes, so we save it
      into gtid_executed table and executed_gtids during
      recovery from the crash.
    */
    if (gtid_state->save(&gtids_in_binlog_not_in_table) == -1)
    
    Fix:
    ====
    The main server thread should update the 'gtid_executed'
    table even when 'super_read_only mode' is turned on.
    'skip_readonly_check' flag is enabled now, for the thread
    which tries to update executed gtid's, in the system table
    during shutdown.
    603eaa2e
    Bug#28183718: CANNOT SHUTDOWN MYSQLD WHEN LAST BINLOG HAS
    Sujatha Sivakumar authored
    GTIDS TO SAVE AND AUTOCOMMIT=0
    
    Problem:
    =======
    When autocommit is set to 0 on GR setup, it is not possible
    to shutdown the R/O server. The message like below is
    printed forever.
    
    11:41.655154Z 0 [Note] InnoDB: Starting shutdown...
    11:41.755413Z 0 [Note] InnoDB: Dumping buffer
    pool(s) to
    12:42.453581Z 0 [Note] InnoDB: Waiting for 1 active
    transactions to finish
    
    Analysis:
    =========
    In group replication setup when single primary mode is
    enabled the secondary servers will have their
    'super_read_only=ON'. During shutdown the main server thread
    will try to save the executed gtid set in 'gtid_executed'
    table. But since the 'super_read_only' mode is enabled on
    the server the update operation fails.
    
    When AUTOCOMMIT=0 the transaction that was started while
    opening the 'gtid_executed' table doesn't complete. This
    makes the main server thread to wait indefinitely for the
    transaction to complete.
    
    When AUTOCOMMIT=1, even though update to 'gtid_executed'
    operation fails as 'super_read_only' is on,  it completes
    the active transaction. Hence shutdwon is complete but table
    is not updated.
    
    The gtid_executed table is updated upon next server restart
    as part of following code.
    
    /*
    Save unsaved GTIDs into gtid_executed table, in the following
    four cases:
      1. the upgrade case.
      2. the case that a slave is provisioned from a backup of
         the master and the slave is cleaned by RESET MASTER
         and RESET SLAVE before this.
      3. the case that no binlog rotation happened from the
         last RESET MASTER on the server before it crashes.
      4. The set of GTIDs of the last binlog is not saved into
      the gtid_executed table if server crashes, so we save it
      into gtid_executed table and executed_gtids during
      recovery from the crash.
    */
    if (gtid_state->save(&gtids_in_binlog_not_in_table) == -1)
    
    Fix:
    ====
    The main server thread should update the 'gtid_executed'
    table even when 'super_read_only mode' is turned on.
    'skip_readonly_check' flag is enabled now, for the thread
    which tries to update executed gtid's, in the system table
    during shutdown.
Loading