Help Center> GeminiDB> API Reference> APIs v3 (Recommended)> Disaster Recovery> Obtaining the Status of Data Synchronization Between Two DR Instances
Updated on 2023-11-21 GMT+08:00

Obtaining the Status of Data Synchronization Between Two DR Instances

Function

This API is used to obtain the status of data synchronization between two DR instances (primary and standby instances), primary instance ID, data synchronization metrics, and RPO and RTO values in switchover and failover scenarios.

Constraints

This API supports GeminiDB Redis instances.

URI

GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/disaster-recovery/data-synchronization

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a user in a region. To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

master_instance_id

String

Primary instance ID.

slave_instance_id

String

Standby instance ID.

status

String

Status of data synchronization between two DR instances.

Value options:

  • NA indicates that there is no DR relationships between the two instances.
  • NEW indicates that data synchronization is not started.
  • SYNCING indicates that data synchronization is in progress.
  • SUSPENDING indicates that data synchronization is being paused.
  • SUSPENDED indicates that data synchronization has been paused.
  • RECOVERYING indicates that data synchronization is being resumed.

data_sync_indicators

object

Data synchronization metric. A value is returned only when the requested instance ID is the primary instance ID. For details, see Table 4.

rto_and_rpo_indicators

Array of objects

RPO and RTO values in failover or switch over scenarios. A value is returned only when the requested instance ID is the primary instance ID. For details, see Table 5.

Table 4 NoSQLDrDataSyncIndicators

Parameter

Type

Description

rsync_ops

Long

Rate that rsync transfers data on each node.

rsync_wal_size

Long

Size (in MB) of WAL files to be synchronized on each node.

rsync_push_cost

Long

Average time (in us) required for rsync to push data from the time when a synchronization message is put into the message queue to the time when a response is received.

rsync_send_cost

Long

Average time (in us) required for rsync to send data from the time when a synchronization message is taken out of the message queue to the time when a response is received.

rsync_max_push_cost

Long

Maximum time (in us) required for rsync to push data in a collection period.

rsync_max_send_cost

Long

Maximum time (in us) required for rsync to send data in a collection period.

rsync_status

Integer

Synchronization status of rsync. The value 1 indicates that rsync is synchronizing data. The value 0 indicates that rsync is not synchronizing data.

Table 5 NoSQLDrRpoAndRto

Parameter

Type

Description

scene

String

Scenario. The value can be FAILOVER or SWITCHOVER. FAILOVER indicates that roles of DR instances are forcibly switched even though data synchronization has not completed. SWITCHOVER indicates that the roles are switched after data synchronization completes.

Value options:

  • FAILOVER
  • SWITCHOVER

rpo

Long

Maximum acceptable amount of data loss (measured by time, in seconds) during a switchover or switchover.

rto

Long

Maximum acceptable amount of time (in seconds) for restoring a database and regaining access to it.

Example Requests

  • URI example
    GET https://gaussdb-nosql.ap-southeast-1.myhuaweicloud.com/v3/0549b4a43100d4f32f51c01c2fe4acdb/instances/b0965c9010f44ffca9af4ee00746aa8din12/disaster-recovery/data-synchronization
  • Example request body

    None

Example Responses

Status code: 200

Success

The requested instance ID is the primary instance ID:
{ 
  "master_instance_id": "b0965c9010f44ffca9af4ee00746aa8din12", 
  "slave_instance_id": "c0965c9010f44ffca9af4ee00746aa8din12", 
  "status": "SYNCING", 
  "data_sync_indicators": { 
    "rsync_ops": 100, 
    "rsync_wal_size": 30, 
    "rsync_push_cost": 30, 
    "rsync_send_cost": 20, 
    "rsync_max_push_cost": 35, 
    "rsync_max_send_cost": 25, 
    "rsync_status": 1 
  }, 
  "rto_and_rpo_indicators": [ 
    { 
      "scene": "SWITCHOVER", 
      "rpo": 20, 
      "rto": 40 
    }, 
    { 
      "scene": "FAILOVER", 
      "rpo": 20, 
      "rto": 40 
    } 
  ] 
} 
The requested instance ID is the standby instance ID:
{ 
  "master_instance_id": "c0965c9010f44ffca9af4ee00746aa8din12", 
  "slave_instance_id": "b0965c9010f44ffca9af4ee00746aa8din12", 
   "status": "SYNCING" 
}

Status Codes

For details, see Status Codes.

Error Codes

For details, see Error Codes.