Updated on 2025-02-17 GMT+08:00

Forcibly Stopping Synchronization of GaussDB Distributed

This section describes how to delete residual logical replication slots that may remain in the source distributed GaussDB database after an incremental or a full+incremental synchronization task is forcibly stopped.

Procedure

  1. Query the replication slot name used by DRS in "create replication slot [Replication slot name] successfully by replication connection" on the Synchronization Logs page.
  2. In the distributed multi-task mode, log in to each primary DN of the distributed GaussDB database as the user used when you tested the connection between the DRS instance and the distributed GaussDB instance. In the distributed single-task mode, log in to the CN of the distributed GaussDB database as the user used when you tested the connection between the DRS instance and the distributed GaussDB instance.
  3. Run the following statement to query information about all replication slots in the database selected in the synchronization task:

    select slot_name from pg_replication_slots where database = 'database';

    In the preceding command, database indicates the database selected in the synchronization task.

  4. If the query result contains the replication slot name used by the DRS task but the replication slot is not used (active='f'), run the following statement to delete its logical replication slot:

    select * from pg_drop_replication_slot('slot_name');

    In the preceding command, slot_name indicates the replication slot name queried in 1.

  5. In the distributed multi-task mode, run the following statement on DNs to check whether the logical replication slot is successfully deleted. In the distributed single-task mode, run the following statement on both CNs and DNs to check whether all logical replication slots are successfully deleted.

    select slot_name from pg_replication_slots where slot_name = 'slot_name';

    If the query result is empty, the logical replication slot is deleted.

  6. Repeat the preceding steps to ensure that logical replication slots on all nodes are successfully deleted.