Help Center/DataArts Studio/FAQs/DataArts Migration (Real-Time Jobs)/How Do I Manually Delete Replication Slots from a GaussDB Data Source?
Updated on 2026-03-20 GMT+08:00

How Do I Manually Delete Replication Slots from a GaussDB Data Source?

Symptom

The replication slots of the GaussDB data source cannot be automatically deleted. When the number of replication slots reaches the upper limit, you must manually delete them. If a job is no longer needed, you must also delete replication slots to prevent redundant logs.

Possible Cause

The replication slots of the GaussDB data source cannot be automatically deleted.

Solution

  1. Determine the replication slot to delete. The replication slot name is in migration_Job ID format. You can obtain the job ID on the real-time migration job monitoring page.
    • Method 1:
      Figure 1 Viewing the job ID

    • Method 2:
      Figure 2 Viewing the job ID

  2. Log in to the source database used by the job.
  3. Query the name of the streaming replication slot corresponding to the database object selected for the synchronization task.
    select slot_name from pg_replication_slots where database = 'database';
  4. Run the following statement to delete the corresponding streaming replication slot:
    select * from pg_drop_replication_slot('slot_name');
  5. Run the following statement to check whether the streaming replication slot is deleted:
    select slot_name from pg_replication_slots where slot_name = 'slot_name';
  6. For GaussDB Distributed, perform the operation on each shard. First, check the name of each shard.

    SELECT distinct node_name FROM pgxc_node
  7. Run the SQL statement on specified shards.
    EXECUTE DIRECT ON(dn_6001_6002) 'select pg_drop_replication_slot(''slot_name'')';
    EXECUTE DIRECT ON(dn_6003_6004) 'select pg_drop_replication_slot(''slot_name'')';