In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following is an introduction to the three event types in MySQL binlog: XID_EVENT, ROTATE_EVENT and STOP_EVENT. The secret of the text is that it is close to the topic. So, let's skip the gossip and read the following directly. I'm sure you'll benefit from reading this article on the introduction of the three event types XID_EVENT, ROTATE_EVENT and STOP_EVENT in MySQL binlog.
1 、 XID_EVENT
When a transaction commits, a XID_EVENT is added to the binlog in both statement and row format as the end of the transaction. This event records the ID of the transaction. When mysql performs crash recovery, it decides whether to commit a transaction in the state of prepared in the storage engine based on the commit in binlog.
2 、 ROTATE_EVENT
When the binlog file size reaches the value set by the max_binlog_size parameter or when the flush logs command is executed, the binlog switches, and a ROTATE_EVENT event is added to the end of the currently used binlog file to record the name and location of the next binlog file in the event.
3 、 STOP_EVENT
When the MySQL service stops, a STOP_EVENT event is added to the end of the current binlog file to indicate the stop of the database. The event includes only one public event header, and there is no private event header and event body. Only the event type of the public event header is needed.
4. Code
Xid_log_event::write Log_event::write_header wrapper_my_b_safe_write (file, (uchar*) & xid, sizeof (xid)) write_footer (file)) / / checksumRotate_log_event::write write_header (file, ROTATE_HEADER_LEN + ident_len) wrapper_my_b_safe_write (file, (uchar*) buf, ROTATE_HEADER_LEN) wrapper_my_b_safe_write (file, (uchar*) new_log_ident (uint) ident_len)
Write_footer (file))
Is there anything you don't understand about the introduction of the three event types XID_EVENT, ROTATE_EVENT and STOP_EVENT in the above MySQL binlog? Or if you want to know more about it, you can continue to follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.