mysql5.7: Semi-synchronous replication enhancements

Source: Internet
Author: User

mysql5.7.4 's document has a sentence:

Http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-4.html

replication:implemented separate threads for sending and receiving semisynchronous Replication acknowledgement signals, s O that event streams and ACK streams can is sent and received simultaneously. This should reduce many common delays and thus improve performance with semisynchronous replication in a number of setting S.


This sentence is not very small, in fact, very powerful, explain:

In the 5.7.4 version of the Semi Sync Framework, a separate thread is called ack_receive, specifically for receiving feedback from slave.
This way, Master has two processes working independently, one sending Binlog to slave, and the other receiving slave feedback. In the previous version, Master had only one process Binlog dump, which was responsible for sending Binlog to slave and receiving slave feedback.


You can observe the mysqld process with Pstack:

Thread 0x7f339d64d700 (LWP 4860):
#0 0x000000382ac0b98e in [email protected] @GLIBC_2.3.2 () from/lib64/libpthread.so.0
#1 0x0000000000eead0a in Mysql_bin_log::wait_for_update_bin_log (thd*, Timespec const*) ()
#2 0x0000000000f0a6fe in Binlog_sender::send_binlog (st_io_cache*, unsigned long Long) ()
#3 0x0000000000f0a987 in Binlog_sender::run () ()
#4 0x0000000000f04b81 in Mysql_binlog_send (thd*, char*, unsigned long, gtid_set*, unsigned int) ()
#5 0x0000000000f076e7 in Com_binlog_dump (thd*, char*, unsigned long) ()
#6 0x0000000000d233d6 in Dispatch_command (thd*, Com_data const*, Enum_server_command) ()
#7 0x0000000000d24904 in Do_command (thd*) ()
#8 0x0000000000df5b14 in Handle_connection ()
#9 0x0000000000f6ff04 in Pfs_spawn_thread ()
#10 0x000000382ac079d1 in Start_thread () from/lib64/libpthread.so.0
#11 0x000000382a8e8b6d in Clone () from/lib64/libc.so.6


Thread 0x7f336b5fe700 (LWP 4298):
#0 0x000000382a8e15e3 in select () from/lib64/libc.so.6
#1 0x00007f339c8859fe in Ack_receiver::run () () from/usr/lib64/mysql/plugin/semisync_master.so
#2 0X00007F339C885DC9 in Ack_receive_handler () from/usr/lib64/mysql/plugin/semisync_master.so
#3 0x0000000000f6ff04 in Pfs_spawn_thread ()
#4 0x000000382ac079d1 in Start_thread () from/lib64/libpthread.so.0
#5 0x000000382a8e8b6d in Clone () from/lib64/libc.so.6


It is clear that we have seen something new: Ack_receive, which comes from the semisync_master.so plugin.


After the actual test, with this thing, the semi-synchronous architecture of the overall TPS has a small increase.




This article is from the "Memory Fragments" blog, so be sure to keep this source http://weikle.blog.51cto.com/3324327/1792233

mysql5.7: Semi-synchronous replication enhancements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.