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

Steps for setting parameters of MGR self-increasing sequence

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

I. description on the official website

When Group Replication is started on a server, the value of auto_increment_increment is changed to the value of group_replication_auto_increment_increment, which defaults to 7, and the value of auto_increment_offset is changed to the server ID. The changes are reverted when Group Replication is stopped. These settings avoid the selection of duplicate auto-increment values for writes on group members, which causes rollback of transactions. The default auto increment value of 7 for Group Replication represents a balance between the number of usable values and the permitted maximum size of a replication group (9 members).

The changes are only made and reverted if auto_increment_increment and auto_increment_offset each have their default value of 1. If their values have already been modified from the default, Group Replication does not alter them. From MySQL 8.0, the system variables are also not modified when Group Replication is in single-primary mode, where only one server writes.

Knock on the blackboard and highlight. In the MySQL8.0 version, the group is copied in a single main mode (there is only one write server), and the system variables (self-increment sequence parameters) are not automatically modified. This is a passage added in the new version, and I also found this problem in the test, which was confirmed on the official website. Knowledge is knowledge. The process of finding answers is interesting either when someone tells you or you find the answers yourself.

II. Verification process

1. System default parameters

2. The self-increment sequence table, which is self-incremented according to the default parameters, has not been modified.

III. Suggestions

1. It is suggested that we still use the single master mode in MGR.

2. Know every parameter you want to modify like the back of your hand, otherwise don't change it.

3. The lessons learned on paper are not profound, and we should share more tests and experiments.

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

Database

Wechat

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

12
Report