Skip to content

Blue / green deployment fail switch-over

0

I created a Blue-green deployment from my postgres db, from 14 to 18 version. Everything says that is available I can see the blue and green deployment great. The main issue is when I tried to switchover it fails. Asking to amazon Q I tried multiple stuff but nothing works, no I am in a dead end, I tried to execute this query:

SELECT pg_create_logical_replication_slot( 'rds_us_west_2_k3rnplmz35fyhlz6ib7nsoj6nm_sub_16402', 'pgoutput' );

ERROR: must be superuser or replication role to use logical replication slots in the 'rds' namespace

SQL state: 42501

Looks like only Amazon can do this for me.

asked a month ago73 views

2 Answers
2

Hi,

Can you please check the Events section of your resource ? Refer - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/logs-events-streams-console.html

In the Events, there should be a message of switchover failure, but along with this, there should be one or more event(s) of error that can give a hint why switchover failed.

AWS
SUPPORT ENGINEER

answered a month ago

EXPERT

reviewed a month ago

0

Based on the error you're encountering during switchover, it appears your blue/green deployment is failing due to DDL (Data Definition Language) changes or large object modifications that occurred on the blue database after the deployment was created.

When you attempt a switchover, Amazon RDS blocks it if there are DDL or large object changes on the database that can't be replicated through logical replication. Blue/green deployments don't support these types of changes during the replication process.

To resolve this issue, you'll need to:

  1. Delete the current blue/green deployment along with the green environment
  2. Recreate the blue/green deployment from scratch
  3. Avoid making any DDL changes (like CREATE, ALTER, DROP statements) or large object modifications on the blue database while the deployment is active

To prevent this issue in future deployments, you can configure event triggers and trigger functions on your blue database before starting the blue/green deployment. These triggers will notify you of any DDL operations that could cause problems during switchover.

Regarding the replication slot error you're seeing - this is expected behavior. The 'rds' namespace for replication slots is reserved for AWS-managed operations, and you don't need to manually create these slots. Amazon RDS manages the logical replication slots automatically for blue/green deployments.

The key is to ensure no DDL changes occur on your blue database after creating the deployment and before completing the switchover.
Sources
Troubleshoot Amazon RDS for PostgreSQL blue/green deployment errors | AWS re:Post
Block DDL during logical replication for PostgreSQL | AWS re:Post

answered a month ago

EXPERT

reviewed a month 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.