Skip to content

CDC-only task failed with error: Failed to create a subscription on target database

0

I am getting error when running the migration task with type Full Load + CDC/CDC, I am able to load/migrate the data using Full Load. Below is the error,

[ERROR]: CDC-only task failed with error: Failed to create a subscription on target database <target_database_endpoint> Additional Info,

  1. Have setup rds.logical_replication=1 in parameter group of both the source and target DB servers. (Still confused if I have to setup this up for source or target?)
  2. Have setup wal_sender_timeout=0
  3. I am using default master user/role created at the time of RDS Instance creation which is postgres with its credentials stored in SecretManager and attached to Migration Project with Secret Manager Access Role. I am using master user/role since it has most of the priviledges required for replication.
2 Answers
0

Hello Wasim,

The rds.logical_replication=1 has to be set up on source.

Create a replication slot with

SELECT * FROM pg_create_logical_replication_slot('my_slot', 'test_decoding');

and use that slot as the replication area for DMS task.

Let me know if it fixed your issue.

EXPERT

answered 2 years ago

  • Hi Giovanni,

    I have rds.logical_replication=1 already set up on source, and created the replication slot as mentioned in above query, and used that slot restart_lsn in my DMS task, I am still facing the same issue.

    Error Logs from DMS Task ->

    [INFO]: Fetched Replication Statistics. Replication Slot Lag: [512 MB], Replication State: [f], Confirmed Flush Lsn: [BC8/C000060] [ERROR]: ERROR: could not connect to the publisher: connection to server at "<source_db_endpoint>" (public_ip_rds_source_db), port 5432 failed: Connection timed out Is the server running on that host and accepting TCP/IP connections? [ERROR]: CDC-only task failed with error: Failed to create a subscription on target database atica-postgresql-dest-db-dev.cpzz1aikoilq.us-east-1.rds.amazonaws.com [ERROR]: Replication has been failed after 5 retries. Please check the database logs. [INFO]: Migration task KFEJUQPLJVT2SDYW26Y7RVRPM2OLNT finished. Migration status: Failed

    Logs from RDS DB Logs & Events (Logs Section) <db_user>@<db_name>:[2912]:LOG: could not receive data from client: Connection timed out

    Additional Info,

    1. Source DB is in another region with default VPC config
    2. Destination DB is in another region with customer managed VPC
    3. Both VPCs have VPC Peering enabled and configured correctly.
    4. Both DB server's SG allows the inbound traffic from each others VPC CIDR
0

I assume you are using AWS DMS homogeneous data migration

this requires setting up logical replication on both source and target as it uses publisher and subscriber model for cdc. Do review the permissions as per below link https://docs.aws.amazon.com/dms/latest/userguide/dm-data-providers-target-postgresql.html

AWS

answered 2 years ago

  • Hi Subhash Yes, I have set logical replication on both side

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.