What Should I Do If a Job with PostgreSQL/GaussDB as the Source Fails to Be Started and Error "replication slot "xxx" is already active" Is Reported?
Symptom
A real-time job with PostgreSQL/GaussDB as the source fails to be started and error "replication slot "xxx" is already active" is reported.
Possible Causes
PostgreSQL/GaussDB data synchronization depends on logical replication slots. If a replication slot is used by a real-time job, it cannot be used by other jobs.
Solution
- Find the job that is using the replication slot based on the job ID in the replication slot name suffix. If the job can be stopped, stop it and restore the job that reports the error.
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
- Method 1
- Use an idle or a new replication slot.
- Run the following command to query the replication slot status:
select slot_name, active from pg_replication_slots
If the value of active is false, the replication slot is idle. Otherwise, the replication slot is working.
In normal cases, the replication slot used by each job is unique because each job has a unique ID. However, if a custom replication slot is used, conflicts may occur.
- Customize a replication slot.
Figure 3 Customizing a replication slot
- Run the following command to query the replication slot status:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot