All Products
Search
Document Center

Tair:Modify the synchronization mode of a persistent memory-optimized instance

Last Updated:Mar 27, 2024

By default, Tair persistent memory-optimized instances use the asynchronous mode. In scenarios where data durability is critical, you can change the mode to semi-synchronous in the console to improve data security.

Prerequisites

A persistent memory-optimized instance of minor version 1.2.4 or later is created.

Note

The synchronization mode cannot be changed for persistent memory-optimized instances whose minor version is earlier than 1.2.4. For information about how to update the minor version of an instance, see Update the minor version of an instance.

Synchronization mode overview

Open source Redis uses the asynchronous replication mechanism for data synchronization between the master and replica nodes. In this mode, after the master node processes a request and returns the response to the client, the system synchronizes data from the master node to the replica node. In this case, if a master-replica switchover is triggered by an instance failure, data inconsistency may occur between the master and replica nodes.

In semi-synchronous mode, after the master node processes a request, the system synchronizes logs from the master node to the replica node. The master node does not respond to the client until the master node receives a success response from the replica node. This way, data consistency is guaranteed even if a master-replica switchover occurs.

The following figure shows how these two modes work.异步复制和半同步复制流程图

Precautions

When you enable or disable semi-synchronous replication, full data replication is triggered between the master and replica nodes. We recommend that you change the mode during off-peak hours.

Procedure

  1. Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the upper-right corner of the Basic Information section, click Change Synchronization Mode.

  3. In the panel that appears, configure the parameters that are described in the following table.

    Parameter

    Description

    Synchronization Mode

    Default value: Asynchronous. Valid values:

    • Semi-Synchronous: The master node responds to the client only after logs are received by the replica node.

      Important
      • When you turn on or turn off Semi-Synchronous, full data replication is triggered between the master and replica nodes. We recommend that you change the mode during off-peak hours.

      • If the replica node is unavailable or the communication between the master and replica nodes is abnormal, semi-synchronous replication degrades to asynchronous replication.

    • Asynchronous: The asynchronous replication mechanism of open source Redis is used.

    Degradation Threshold

    This parameter is available only if you set Synchronization Mode to Semi-Synchronous. Unit: ms. Valid values: 10 to 60000. Default value: 500.

    If the latency of data synchronization between the master and replica nodes exceeds the threshold, the synchronization mode is automatically changed to Asynchronous. After the latency decreases to a value lower than the threshold, the synchronization mode is automatically changed back to Semi-Synchronous.

  4. Click OK.