Skip to content
  • Daogang Qu's avatar
    1adfcd4e
    Bug #19594845 INCIDENT LOG EVENTS SHOULD HAVE UNIQUE GTIDS WHEN GTID MODE IS ON · 1adfcd4e
    Daogang Qu authored
    Currently, if any Incident event occurs that breaks RPL, the incident
    is binlogged without GTIDs. Due to this, if user wants to skip the
    Incident event through general commands of GTID i.e.
    'set gtid_next=<GTID>; begin; commit;', user cannot. User has to take
    approach of setting the relaylog file and relaylog positions to post
    incident_log_events to skip such incidents. Specially, when
    autoposition is ON, user has to stop the autoposition, then set the
    relaylog file/pos and then set it back to ON.
    
    To fix the problem, we write the Incident event into stmt_cache, so
    that a GTID is generated and written for it prior to flushing the
    stmt_cache, and make the slave applier work with the change. Then
    users can skip the Incident event through general commands of GTID
    i.e. 'set gtid_next=<GTID>; begin; commit;'.
    
    Remove testing purpose code at sql/parser.cc, since we don't
    have a real case that generates an incident log event before
    writing the real event to the binary log.
    
    rpl_skip_incident.test and rpl_incident.test are removed, since
    the related testing purpose code at sql/parser.cc is removed and
    skipping incident on slave is tested by the two new added test
    when gtid mode is on and by rpl.rpl_stm_binlog_max_cache_size
    when gtid mode is off.
    
    binlog_incident_ignore.test and binlog_incident.test are updated
    with an incident caused by partially failed GRANT statement.
    1adfcd4e
    Bug #19594845 INCIDENT LOG EVENTS SHOULD HAVE UNIQUE GTIDS WHEN GTID MODE IS ON
    Daogang Qu authored
    Currently, if any Incident event occurs that breaks RPL, the incident
    is binlogged without GTIDs. Due to this, if user wants to skip the
    Incident event through general commands of GTID i.e.
    'set gtid_next=<GTID>; begin; commit;', user cannot. User has to take
    approach of setting the relaylog file and relaylog positions to post
    incident_log_events to skip such incidents. Specially, when
    autoposition is ON, user has to stop the autoposition, then set the
    relaylog file/pos and then set it back to ON.
    
    To fix the problem, we write the Incident event into stmt_cache, so
    that a GTID is generated and written for it prior to flushing the
    stmt_cache, and make the slave applier work with the change. Then
    users can skip the Incident event through general commands of GTID
    i.e. 'set gtid_next=<GTID>; begin; commit;'.
    
    Remove testing purpose code at sql/parser.cc, since we don't
    have a real case that generates an incident log event before
    writing the real event to the binary log.
    
    rpl_skip_incident.test and rpl_incident.test are removed, since
    the related testing purpose code at sql/parser.cc is removed and
    skipping incident on slave is tested by the two new added test
    when gtid mode is on and by rpl.rpl_stm_binlog_max_cache_size
    when gtid mode is off.
    
    binlog_incident_ignore.test and binlog_incident.test are updated
    with an incident caused by partially failed GRANT statement.
Loading