mysql principle ~ binlog Series ~ event Discussion

The specific analysis in a common event binlog

Two core events Row format

     ROW_LOG_EVENT+TABLE_MAP_EVENT+GTID_EVENT

Three event into force mechanism

     Effect binlog cache, and then write a record in binlog

Four specific event content

   0  FORMAT_DESCRIPTION_EVENT

  1 PREVIOUS_GTIDS_LOG_EVENT 

  2  GTID_LOG_EVENT

  3  TABLE_MAP_EVENT

  4  ROW_LOG_EVENT

  5  QUERY_EVENT ()  

  6  XID_EVENT

  7 ROTATE_EVNET

  8 STOP_EVENT

Detailed five

   0 FORMAT_DESCRIPTION_EVENT

     Binlog recorded version and some other related information at the beginning binlog file

  1  PREVIOUS_GTIDS_LOG_EVENT

     Records of all binlog GTID collection before, the role is to speed up the scanning speed 

  2 GTID_LOG_EVENT

    Records relevant information about the GTID, and carries last commited seq number for parallel playback and

 3  QUERY_EVENT

   DDL statements recorded only in the original format Row 

 4  TABLE_MAP_EVENT

    Internal ID and table structure definition described.

    core

    table_id , table_name schema name length  col count col type

    Examples

     Table_map: `yzs`.`t1`   TABLE_ID: '23'

    5  ROW_LOG_EVENT

     Things recorded statement in Row format specific content

  6 XID_EVENT

  When the transaction commits, whether or binlog statement row format will add a XID_EVENT as the end of the transaction. The event ID records of the transaction. When crash recovery in mysql binlog submitted under the circumstances to decide whether to commit the transaction storage engine in prepared state.

  It includes the following events

  WRITE_ROWS_EVENT,UPDATE_ROWS_EVENT,  DELETE_ROWS_EVENT

  7 ROTATE_EVENT

    When the file size reaches max_binlog_size binlog parameter value or command execution flush logs, binlog switching occurs, then the event is added in a ROTATE_EVENT binlog file currently used by the end of the name and location of the next file is recorded into the binlog event .

  8 STOP_EVENT

    When the MySQL service is stopped, will be added to the end of the current binlog file a STOP_EVENT event indicates that the database is stopped

Six summary

   Know the significance of these events, we can expand this multi-dimensional statistical binlog 

 Reference herein Great God eight strange series of courses article,

 

Guess you like

Origin www.cnblogs.com/danhuangpai/p/11484306.html