Skip to content

feat: gdb failover support#1246

Merged
karenc-bq merged 2 commits into
mainfrom
feat/gdb-failover
Jun 16, 2026
Merged

feat: gdb failover support#1246
karenc-bq merged 2 commits into
mainfrom
feat/gdb-failover

Conversation

@karenc-bq

Copy link
Copy Markdown
Contributor

Description

Added GDB Failover support.
Added retry writer connection logic to GDB Failover and Failover 2 plugin.

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

@karenc-bq karenc-bq force-pushed the feat/gdb-failover branch from 410a5e4 to 052135f Compare June 8, 2026 19:53
@karenc-bq karenc-bq marked this pull request as ready for review June 8, 2026 19:53
Comment thread docs/using-the-python-wrapper/using-plugins/UsingTheGdbFailoverPlugin.md Outdated
Comment thread docs/using-the-python-wrapper/using-plugins/UsingTheGdbFailoverPlugin.md Outdated
Comment thread docs/using-the-python-wrapper/using-plugins/UsingTheGdbFailoverPlugin.md Outdated
Comment thread aws_advanced_python_wrapper/utils/retry_util.py Outdated
Comment thread aws_advanced_python_wrapper/gdb_failover_plugin.py
@karenc-bq karenc-bq force-pushed the feat/gdb-failover branch 4 times, most recently from 32dde0e to 69011e9 Compare June 16, 2026 17:29
@karenc-bq karenc-bq force-pushed the feat/gdb-failover branch from 69011e9 to 88363d9 Compare June 16, 2026 23:35
@karenc-bq karenc-bq merged commit fbac62d into main Jun 16, 2026
8 checks passed
@karenc-bq karenc-bq deleted the feat/gdb-failover branch June 16, 2026 23:43
AhmadMasry added a commit to AhmadMasry/aws-advanced-python-wrapper that referenced this pull request Jun 17, 2026
Brings in gdb failover support (aws#1246). Conflict resolution:

- failover_v2_plugin.py (_failover_writer): took main's RetryUtil-based
  refactor, which replaces the inline writer-candidate logic our branch
  had only lightly tweaked.
- test_aurora_failover.py (test_fail_from_reader_to_writer matrix): kept
  our branch's deliberate drop of host_monitoring (v1) entries (libpq
  teardown SIGSEGV flake fix) while adding main's new gdb_failover
  variant in its v2-only form, per the same rationale.
- retry_util.py (RetryUtil.close_connection): added conn=conn to the
  CONNECTION_CLOSE execute() call to match our branch's convention that
  prevents the cross-thread use-after-free race on close-during-failover.
AhmadMasry added a commit to AhmadMasry/aws-advanced-python-wrapper that referenced this pull request Jun 17, 2026
The merge of main brought in the sync GDB (Aurora Global Database)
failover plugin (GdbFailoverPlugin + RetryUtil) with no async
equivalent. This adds that parity:

- aio/retry_util.py: AsyncRetryUtil, the async port of the sync
  RetryUtil deadline-bounded connect-and-verify-role retry loop.
  Adapted to async: force_connect (not connect) so auth plugins
  re-apply and the pooled provider is bypassed; abort_connection for
  close; each connect await bounded by the remaining deadline so a
  blackholed host can't hang failover.
- aio/gdb_failover_plugin.py: AsyncGdbFailoverPlugin(AsyncFailoverPlugin)
  overriding _do_failover with region-aware, GdbFailoverMode-driven
  target selection mirroring the sync plugin's _failover_with_mode.
- aio/failover_plugin.py: extract _is_strict_writer_failover_mode
  (behavior-preserving) so the GDB subclass can make the read-only
  escape hatch region-aware.
- aio/plugin_factory.py: register "gdb_failover" (weight 420).

Reuses GdbFailoverMode, RdsUtils, properties and message keys as-is.
24 new unit tests (test_aio_retry_util.py, test_aio_gdb_failover.py);
full unit suite green (2011 passed), flake8 + isort clean.
AhmadMasry added a commit to AhmadMasry/aws-advanced-python-wrapper that referenced this pull request Jun 17, 2026
… async

Extends the async GDB failover parity to match what aws#1246 did on the sync
side (integration-test matrix + docs):

- test_aurora_failover_async.py: add the distinct `gdb_failover` plugin
  to all 8 failover test matrices alongside `failover_v2` (and
  `gdb_failover,host_monitoring_v2` / `aurora_connection_tracker,gdb_failover`
  for the compound ones), mirroring sync test_aurora_failover.py. Async
  ships one failover plugin so the failover/failover_v2 aliases collapse to
  one entry, but gdb_failover is a separate region-aware plugin and is
  exercised on its own.
- UsingTheGdbFailoverPlugin.md: add an "Async wrapper." note (matching the
  one in UsingTheFailover2Plugin.md) documenting the `gdb_failover` async
  code and that the home-region parameters/modes behave identically in async.

The aws#1246 integration_tests.yml change was only the removal of a temporary
feat/gdb-rw branch trigger (not gdb test config), so nothing to mirror there;
async tests run under the same workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants