Question

Difficulty: MediumDatabase Migration and Schema Conversion using DMS and SCT

A company is migrating a self-managed, on-premises PostgreSQL database to an Amazon Aurora PostgreSQL-Compatible Edition DB cluster. A Solutions Architect successfully converts the database schema using the AWS Schema Conversion Tool (AWS SCT) and applies it to the target cluster. To migrate the data with minimal downtime, the architect plans to use AWS Database Migration Service (AWS DMS) with full load and Change Data Capture (CDC) enabled. However, when starting the DMS task, the full load completes successfully, but the task fails immediately upon transitioning to the CDC phase. Which configuration change must be applied to the source PostgreSQL database to resolve this issue?

  1. Modify the postgresql.conf file to set wal_level = logical, increase max_replication_slots and max_wal_senders to accommodate the migration tasks, and restart the PostgreSQL database instance.Answer
  2. B
    Modify the postgresql.conf file to set wal_level = replica, enable replication parameters, and perform a configuration reload without restarting the database server.
  3. C
    Create a cron job on the source server to copy write-ahead logs (WAL) to an Amazon S3 bucket, and configure the AWS DMS source endpoint to read directly from the S3 bucket using the pg_wal engine.
  4. D
    Enable logical replication on the target Aurora PostgreSQL DB cluster's parameter group, and establish a replication slot on the target cluster pointing back to the source.

Answer

Modify the postgresql.conf file to set wal_level = logical, increase max_replication_slots and max_wal_senders to accommodate the migration tasks, and restart the PostgreSQL database instance.
The correct answer is to modify the postgresql.conf file to set wal_level to logical, increase replication slots and WAL senders, and restart the database. AWS DMS requires logical replication to capture changes on PostgreSQL sources. Setting wal_level to logical enables the writing of logical replication data to the WAL, which is consumed by logical decoding plug-ins via replication slots.

Step-by-Step Solution

1
Open the postgresql.conf file on the source PostgreSQL database server.
Access is gained to edit the configuration parameters.
The configuration parameters that control write-ahead logging level and replication settings reside in this file.
2
Set the wal_level parameter to logical, and set max_replication_slots and max_wal_senders to values matching or exceeding the concurrent DMS tasks.
The parameters are defined for logical replication, which is required for AWS DMS CDC.
AWS DMS requires logical decoding on PostgreSQL to capture ongoing changes, which is only active when wal_level is set to logical.
3
Restart the PostgreSQL database server to apply the changes.
The PostgreSQL database runs with logical replication and CDC features enabled.
Changing the wal_level parameter is a static change that requires a full database restart to take effect.

Key Concept

Configuring PostgreSQL sources for AWS DMS CDC requires setting the WAL level to logical and provisioning replication slots.
Rate this question