Skip to content

DMS: Is there a way to prevent the target from detaching on an apply error

0

After a full load its common to have to replay some logs and you might end up inserting a record that already exists. You get an apply error.

The problem is the target disconnects and then reconnects. There is a delay. So it basically seems to cause the dms latency to spike and replication comes to a crawl.

The workaround is to have 2 jobs running. One for after the full load and then one to clean up the mess, but not ideal. I've tried to ignore_record and such in the logging, but I don't think that effects what happens to the target connection/endpoint.

2024-09-24T13:44:51.000-05:00 2024-09-24T18:44:51 [TASK_MANAGER ]I: Postgres apply or data error. Failing stream component to retry at subtask 0, component st_0_HTPDSKIA2ZMJXBLMMYYCQI7JEE [1022521] (subtask.c:1462)

2024-09-24T13:44:51.000-05:00 2024-09-24T18:44:51 [TARGET_APPLY ]I: Target component st_0_HTPDSKIA2ZMJXBLMMYYCQI7JEE was detached because of postgres data or apply error. Will try to reattach (subtask.c:1585)

asked 2 years ago282 views

1 Answer
0

I did figure this out eventually. By default RecoverableErrorInterval is set to 5. You have to used advanced settings/json to set this if I remember correctly.

https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.ErrorHandling.html

Anyways by setting this to 0 restarting a CDC task from a checkpoint started quite a bit faster. Even though I grabbed the checkpoint value from the other job it seem to be a few transactions before the end and so was replaying and causing some insert errors.

answered 2 years ago

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.