Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of MYSQL Write Set

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

The editor will share with you the example analysis of MYSQL Write Set. I hope you will get something after reading this article. Let's discuss it together.

MYSQL-based group replication is actually a mature technology, from MYSQL 5.6 to the current 8, it is close to the initial mature stage.

But exactly why GROUP REPLICATION is faster than traditional master-slave replication is a question. Let's talk about why group replication is faster than your traditional replication.

First of all, we have to understand two things: why group replication? there are only two reasons.

1 provides faster replication between members

2 provide authentication among multiple members

Where on earth is WRITE-SET faster than the original copy?

First of all, we need to understand several questions and related parameters.

Binlog_transaction_dependency_tracking

This parameter has three options for setting

1 commit_order default value, which is used in sequential application of slave library.

2 writeset depends on the transaction relevance of the master library, and non-sequential parallel applications can be carried out in the slave library.

3 the difference between writeset_session and the second point is the isolation of SESSION.

We can compare the difference between commit_order and writeset_session.

First we can create a table, insert a record, and then observe the changes in two different parameters in the LOG.

CREATE DATABASE test

CREATE TABLE test (id int NOT NULL AUTO_INCREMENT PRIMARY KEY, text varchar (80))

Insert into test (text) values ('3dsjfuiuiree')

Insert into test (text) values ('3dereresdfere')

Insert into test (text) values ('vcdreresdfere')

If we look at the figure, we can clearly see that the first two operations cannot be committed by last_committed, while the last three operations can be submitted by groups.

If we change the relevant settings to order_commit, the replication machines of the three groups will all change, but the result is different from what we expected, and it is useless at all. When you submit, no matter you change it to commit_order, or if binlog_tranaction_dependency_history_size is set to 1, you can't block the group submission mode of MGR.

What makes me wonder is that binlog_tranaction_dependency_history_size itself is a memory hash. I have adjusted it to 1. How can it be commit?

If we use dependency tracking using WRITESETs on the master, those writesets are preserved over time, up to a maximum history size, and then the dependency information is generated based on that.

All my test subjects are transferred to the traditional GTID replication machine, two machines and then the simplest master-slave replication, and then change the replication mode to

Set global binlog_transaction_dependency_tracking = writeset

Then take a look at relay log and find that it is not the way the group is submitted, but rather the way it is submitted in the way of commit_order.

After reading this article, I believe you have some understanding of "sample Analysis of MYSQL Write Set". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report