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

Donot report INCIDENT_EVENT in binary log for transactional changes which are safely rolledback

    XMLWordPrintable

Details

    Description

      # Configure max_binlog_cache_size=4096
      # Generate a multi statement transaction such that the binlog cache size
      # exceeds the configured "max_binlog_cache_size=4096" limit. Observe that
      # an INCIDENT event is written to the binary log even though the statement 
      # was safely rolled back. This INCIDENT event will stop the slave applier thread.
       
      --source include/have_binlog_format_row.inc
      --source include/have_innodb.inc
      --source include/master-slave.inc
       
      SET @old_max_binlog_cache_size= @@global.max_binlog_cache_size;
      SET @old_binlog_cache_size= @@global.binlog_cache_size;
      SET GLOBAL binlog_cache_size=4096;
      SET GLOBAL max_binlog_cache_size=4096;
       
      CREATE TABLE t( f INT) ENGINE=INNODB;
      BEGIN;
      let $counter=72;
      --disable_query_log
      while ($counter) {
      --error 0,1534
      INSERT INTO t VALUES (1);
      dec $counter;
      }
      --enable_query_log
      COMMIT;
      SELECT COUNT(*) from t;
      SHOW BINLOG EVENTS;
      DROP TABLE t;
      eval SET GLOBAL max_binlog_cache_size= @old_max_binlog_cache_size;
      eval SET GLOBAL binlog_cache_size= @old_binlog_cache_size;
       
      --source include/rpl_end.inc
      

      Part of "SHOW BINLOG EVENTS" output:

      master-bin.000001	9288	Annotate_rows	1	9335	INSERT INTO t VALUES (1)
      master-bin.000001	9335	Table_map	1	9379	table_id: 31 (test.t)
      master-bin.000001	9379	Write_rows_v1	1	9417	table_id: 31 flags: STMT_END_F
      master-bin.000001	9417	Annotate_rows	1	9464	INSERT INTO t VALUES (1)
      master-bin.000001	9464	Table_map	1	9508	table_id: 31 (test.t)
      master-bin.000001	9508	Write_rows_v1	1	9546	table_id: 31 flags: STMT_END_F
      master-bin.000001	9546	Xid	1	9577	COMMIT /* xid=140 */
      master-bin.000001	9577	Incident	1	9634	#1 (LOST_EVENTS)
      master-bin.000001	9634	Gtid	1	9676	GTID 0-1-3
      master-bin.000001	9676	Query	1	9783	use `test`; DROP TABLE `t` /* generated by server */
      

      Slave reports following error:

      Last_SQL_Errno	1590
      Last_SQL_Error	The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log
      

      Report INCIDENT event only in a case where safe rollback is not possible.

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              sujatha.sivakumar Sujatha Sivakumar (Inactive)
              Votes:
              1 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.