pg.ddx.io  aws/aws-advanced-jdbc-wrapper GitHub issues and pull requests  
help / color / mirror / Atom feed
From: sergiyvamz (@sergiyvamz) <noreply+sergiyvamz@github.com>
To: aws/aws-advanced-jdbc-wrapper <noreply+aws-aws-advanced-jdbc-wrapper@github.com>
Subject: [aws/aws-advanced-jdbc-wrapper] PR #2242: fix: B/G plugin stuck in POST after a completed switchover
Date: Mon, 16 Nov 2026 18:54:05 +0000
Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2242@github.com> (raw)

### Summary

Fix the Blue/Green plugin getting stuck in POST after a completed switchover.

### Description

After a completed switchover, `resetContextWhenCompleted()` starts fresh monitors, which can still read the finished deployment's POST or COMPLETED status for a few seconds. The fresh context adopted that phase, but it had never collected the start-of-switchover IPs and topology, so the DNS updates that end POST could never be observed. The switchover timer was only started in PREPARATION, so nothing ended it: the provider reported POST forever, logged no warning, and ignored both the deletion of the deployment and the creation of a new one. Seen on Aurora MySQL with 4.6.0 on about half of the application instances.

- A context that never saw the deployment in CREATED now ignores a POST or COMPLETED status. It records the status hash but doesn't adopt the phase or keep the finished deployment's hosts and IPs, so it stays in idle monitoring until a new deployment is created. A context that saw CREATED still adopts POST, including when a fast switchover hides PREPARATION and IN_PROGRESS from it.
- Start the switchover timer in every phase from PREPARATION onwards, so a context that first sees IN_PROGRESS is also bounded. It is a no-op once running.
- When the timer expires, also handle COMPLETED, and reset the context on the unchanged-status path the same way the next status change would. This also stops `bgd.switchoverTimeout` repeating on every unchanged tick.
- Unit tests for the ignored finished status, a context that saw CREATED, a switchover stalled in IN_PROGRESS, and the COMPLETED timeout branch.
- A parameterized test that replays the whole switchover with the finished deployment's status staying readable for 0 ms, 3 s, or longer than the switchover timeout after the reset. On main the 3 s and longer cases stay in POST, which reproduces the split seen in the 4.6.0 case.

### Additional Reviewers

### By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


view thread (8+ messages)  latest in thread

Message-ID: <gh-aws-aws-advanced-jdbc-wrapper-2242@github.com>
Permalink:  ../gh-aws-aws-advanced-jdbc-wrapper-2242@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox