Group Replication now interacts with the Group Communication Engine more efficie...

 3 years ago
source link: https://www.tuicool.com/articles/hit/qIVFzmv
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

MySQL 8.0.14 comes with a plethora of new features. Some of the new Group Replication featureshave userfacing options, someimpact user-facing options, and others stay completely under the hood. This post will present one of the under-the-hood changes in MySQL 8.0.14: the way the Group Replication layer interacts with the underlying Group Communication Engine layer, XCom .

Figure 1 shows a diagram of the Group Replication architecture.

feqQFbr.png!web Figure 1: The Group Replication architecture.

Each group member is running a MySQL server instance making use of the Group Replication plugin. The plugin itself is built atop XCom, which provides a group communication service to Group Replication via the Group Communication System API (GCS). For example, GCS provides a group with dynamic membership and total-order broadcast of messages within the group.

Before MySQL 8.0.14, when Group Replication interacted with its local XCom instance via GCS, that interaction took place through XCom’s TCP socket. The same socket that the local XCom instance uses to communicate with the XCom instances of other group members. You know, the one you configure using the group_replication_local_address system variable.

Using the XCom’s TCP socket to interact with the local XCom instance had the benefit of code simplicity and uniformity, since the way GCS interacted with a local or remote XCom was the same. However, using the socket had some drawbacks, such as:

  • (De)serialization of requests, and
  • Memory copying throughout the network stack.

In MySQL 8.0.14, like Figure 2 depicts, GCS uses a shared-memory queue to interact with its local XCom instance instead of the TCP socket. Using the shared-memory queue allows GCS to do away with the aforementioned drawbacks, since they were a consequence of using networking mechanisms to interact with the local XCom instance.

7fYnAfm.png!web Figure 2: In MySQL 8.0.14, the Group Communication System API uses a shared-memory queue to interact with the underlying XCom instance.

For those of you interested in the more low-level details, the shared-memory queue is a concurrent, multi-producer, single-consumer queue implemented using C++11 atomics .

MySQL 8.0.14 is out , give it a spin and let us know what you think.

78 total views, 30 views today

About Joyk

Aggregate valuable and interesting links.
Joyk means Joy of geeK