Skip to content

DMS Serverless CDC task not capturing newly added PostgreSQL columns

0

I have an Amazon RDS for PostgreSQL source table that is being replicated continuously using AWS DMS Serverless in CDC mode. pglogical is enabled, and the DMS task reads from PostgreSQL and sends the changes to Kinesis.

The table was already part of an ongoing replication task. Recently, a few new columns were added to this existing table. Since then, those new columns have not appeared in the replicated data being sent to Kinesis.

I have tried stopping and resuming the DMS Serverless replication, but the new columns still do not populate in the output records.

My questions are:

  1. Does AWS DMS Serverless cache table metadata or column definitions internally for an active CDC task?
  2. Can a DMS Serverless replication get stuck using an older version of the table schema after columns are added?
  3. What is the recommended way to force DMS Serverless to refresh the table schema for an existing CDC table?
  4. Are there Serverless equivalents for operations like RefreshSchemas or ReloadTables? I have seen these referenced for AWS DMS Classic, but I am not sure whether they apply to DMS Serverless.
  5. Is recreating the DMS Serverless replication the only reliable way to pick up new columns on an existing CDC table?

Any guidance on the correct process for handling schema changes in AWS DMS Serverless CDC replication from Postgres to Kinesis would be appreciated.

2 Answers
0

Hello.

Is it possible to view details such as table information by enabling the following settings under "Kinesis endpoint settings"?
https://docs.aws.amazon.com/dms/latest/APIReference/API_KinesisSettings.html

{
  "IncludeControlDetails": true,
  "IncludeTableAlterOperations": true,
  "IncludeNullAndEmpty": true
}
EXPERT

answered 2 months ago

EXPERT

reviewed 2 months ago

-1

When AWS DMS doesn't capture new columns added to a source table during CDC replication, it's typically because schema evolution isn't properly configured. Here's what you need to know:

Schema Change Handling

AWS DMS can miss new columns if schema evolution isn't activated. To resolve this, you need to modify your task's DDL handling policy:

  1. Stop your DMS Serverless replication task
  2. Modify the task settings using the JSON editor
  3. Locate the ChangeProcessingDdlHandlingPolicy section
  4. Set the HandleSourceTableAltered parameter to true

This configuration tells DMS to capture ALTER TABLE operations, including new column additions.

Refreshing the Schema

After enabling schema change handling, you'll need to reload the affected table to include the new columns in your Kinesis output. Simply resuming the task after the configuration change won't retroactively add the missing columns to your data stream - a table reload is necessary to pick up the new schema.

Best Practice

The recommended approach is to configure HandleSourceTableAltered to true before starting CDC replication. This allows DMS to automatically handle schema changes as they occur, preventing the issue you're experiencing.

If you haven't configured this setting from the start, you'll need to stop the task, modify the DDL handling policy as described above, resume the task, and then reload the table to ensure the new columns appear in your replicated data.

This approach applies to DMS tasks generally, including DMS Serverless configurations, and doesn't require recreating your entire replication setup.
Sources
Resolve inconsistent data with Amazon S3 as the target for AWS DMS migration | AWS re:Post

answered 2 months ago

  • HandleSourceTableAltered is already set to True.

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.