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

Talking about MGR-the communication module Part2 between members

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

The communication module is divided into three parts.

1. The local packet receiving part is responsible for receiving data transmission requests from local members to other modules, and the received data packets are put into the local data queue for processing.

two。 The communication part between members is responsible for communicating with other members. Communication work includes reading packets from the local data queue and sending them to other members, and receiving packets sent by other members. The communication between the members uses the Paxos protocol.

3. The global packet sending section returns all packets sequentially to the global transaction authentication module on the local member.

When the communication module of each member receives the data transmission request of the upper module, these concurrent data requests are disordered, for example, the three members have one packet respectively, which is the data packet generated by T1, T2 and T3 respectively. These concurrent, unordered packets are aggregated to each member through the Paxos protocol and sorted. Eventually, each member's communication module will have the same packets, and these packets will be sent to the global transaction authentication module on their respective members in the same order.

The core work of the Paxos protocol is to aggregate and sort all the data packets. In order to complete these functions, the Paxos protocol itself will carry out three TCP communications.

A communication module that sends packets to other members.

The communication modules of other members respond to received packets.

When more than half of the communication modules (including itself) respond, send a message to all members that the packet is synchronized successfully. Only when the three steps of the Paxos protocol are successfully completed will the communication module send the packet to the global authentication module.

Paxos has the following characteristics in communication.

Successful packet synchronization requires three TCP transmissions.

Each packet is sent to all members, so multiple copies need to be transmitted, and the amount of data transmitted will be magnified.

Assuming that the process of sending packets to all members is concurrent, the time required for successful packet synchronization is the time to complete three TCP communications on the slowest link between members.

These characteristics determine that the efficiency of MGR in the network with large delay and low bandwidth will be relatively low. In order to improve the adaptability of Paxos to the network, MGR has made the following optimization.

Use the LZ4 compression algorithm to compress the information of things, and it will be compressed automatically when the size of the packet exceeds a threshold. For more information, see the meaning of the variable group_replication_compression_threshold.

Paxos encapsulates multiple local transaction information into a single packet for communication, which greatly reduces the number of Paxos communications.

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