Change the synchronization mode of a Tair (Enterprise Edition) instance

Updated at:

By default, Tair (Enterprise Edition) instances use asynchronous replication. You can switch to semi-synchronous mode at the cost of increased write latency (typically hundreds of microseconds to several milliseconds). If the replica node becomes abnormal, the instance falls back to asynchronous replication, and data loss remains possible.

Prerequisites

Before you begin, ensure that:

  • For DRAM-based instances: the instance is compatible with Redis 6.0 or later and runs minor version 24.8.0.0 or later

  • For ESSD/SSD-based instances: the instance runs minor version 2.5.2 or later

Note

Instances on earlier minor versions do not support changing the synchronization mode. To update, see Upgrade minor and proxy versions.

How it works

Open source Redis uses asynchronous replication: the master node responds to the client immediately after processing a request, then synchronizes data to the replica node in the background. If a master-replica switchover is triggered before the replica catches up, data inconsistency can occur.

In semi-synchronous (Semisync) mode, after the master node completes an update initiated by a client, it synchronizes the logs to the replica node and responds to the client only after the replica node acknowledges receipt. If the replica node encounters an abnormal condition, the system automatically falls back to asynchronous replication. Data loss remains possible in this degraded state and in extreme scenarios such as simultaneous failures of the master and replica nodes.

The following diagram shows how both modes work.

image

When semi-synchronous replication degrades

Semi-synchronous mode automatically degrades to asynchronous replication when:

  • The replica node becomes unavailable, or

  • The replication latency between the master and replica nodes exceeds the Degradation Threshold

If a master-replica switchover occurs while the instance is in a degraded (asynchronous) state, data written after degradation began may be lost. For example:

  1. The replica node becomes slow. Replication latency exceeds the Degradation Threshold.

  2. The instance automatically degrades to asynchronous replication.

  3. A master-replica switchover is triggered (for example, due to a master node failure).

  4. Writes that the replica had not yet received are lost.

To reduce this risk, set the Degradation Threshold to a value that matches your latency tolerance. A lower threshold triggers degradation sooner, but also means the instance degrades more readily under transient network conditions.

Change the synchronization mode

  1. Log in to the console and go to the Instances page. Select the region where the instance resides, 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 following parameters.

    Parameter

    Description

    Sync Mode

    Default: Asynchronous. Set to Semi-Synchronous to enable synchronous log replication. In semi-synchronous mode, the master node responds to the client only after the replica node acknowledges receipt of the logs. If the replica node is unavailable or communication between nodes is abnormal, the mode automatically degrades to asynchronous replication.

    Degradation Threshold

    Available only when Sync Mode is set to Semi-Synchronous. Unit: ms. Valid values: 10–60000. Default: 500. When the replication latency between master and replica exceeds this threshold, the synchronization mode automatically changes to Asynchronous. When latency drops back below the threshold, it changes back to Semi-Synchronous.

  4. Click OK.