Forcibly Stopping Synchronization of GaussDB Distributed
This section describes how to clear the streaming replication slots of the source GaussDB distributed database after the incremental or full+incremental synchronization task is forcibly stopped.
The naming rule of a replication slot depends on the database kernel version (you can run the select working_version_num(); command to view the version). If the version is earlier than 92556, serial decoding is used by default. The naming rule of a replication slot is replication_slot_unique_ID. If the version is 92556 or later, parallel decoding is used by default. The naming rule of a replication slot is drs_unique_ID. To obtain the unique ID, replace the hyphen (-) in the task node ID with an underscore (_). You can find the node ID in the task node id is *** log on the Synchronization Logs page.
Prerequisites
Common users do not have the permission to perform the execute direct operation. To delete streaming replication slots, contact GaussDB O&M personnel.
Procedure
- Log in to each primary DN node of the GaussDB distributed instance as the user used when you tested the connectivity between the DRS instance and the GaussDB distributed instance.
- Run the following statement to query the streaming replication slot name of the database object selected for the synchronization task:select slot_name from pg_replication_slots where database = 'database';Notice
In the preceding command, database indicates the database selected in the synchronization task.
- Run the following statement to delete the streaming replication slot:select * from pg_drop_replication_slot('slot_name');Notice
In the preceding command, slot_name indicates the name of the streaming replication slot queried in 2.
- Run the following statement to check whether the streaming replication slot is successfully deleted:select slot_name from pg_replication_slots where database = 'database';
If the query result is empty, the streaming replication slot is deleted.
- Repeat the preceding operations to ensure that the streaming replication slot on each primary DN is deleted.
- Prerequisites
- Procedure