chore: gdb regions - #1266
Open
karenc-bq wants to merge 1 commit into
Open
Conversation
karenc-bq
force-pushed
the
chore/gdb-aws-region
branch
from
August 6, 2026 01:25
f849461 to
5ef1cc3
Compare
karenc-bq
force-pushed
the
chore/gdb-aws-region
branch
from
August 6, 2026 01:53
5ef1cc3 to
fca73dc
Compare
sophia-bq
reviewed
Aug 6, 2026
| "Comma-separated, region-aware priority list for the Global Database " | ||
| "topology monitor's background connection. Values combine role, region, " | ||
| "and primary/secondary awareness, e.g. 'strict-writer-primary', " | ||
| "'strict-reader-secondary', 'strict-reader-us-east-1', 'us-west-2'.", |
Contributor
There was a problem hiding this comment.
Suggested change
| "'strict-reader-secondary', 'strict-reader-us-east-1', 'us-west-2'.", | |
| "'strict-reader-secondary', 'strict-reader-us-east-1', 'us-west-2' ", |
Unsure if the period was intentional
| self._host_threads_latest_topology: AtomicReference[Optional[Topology]] = AtomicReference(None) | ||
|
|
||
| self._is_verified_writer_connection = False | ||
| # Retained even after _writer_host_info is cleared; node threads use it |
Contributor
There was a problem hiding this comment.
Suggested change
| # Retained even after _writer_host_info is cleared; node threads use it | |
| # Retained even after _writer_host_info is cleared; host threads use it |
| WrapperProperties.CONNECT_TIMEOUT_SEC.set(self._monitoring_properties, self.DEFAULT_CONNECT_TIMEOUT_SEC) | ||
|
|
||
| # Handler that manages the priority of the background monitoring | ||
| # connection and asynchronously upgrades it to a higher-priority node. |
Contributor
There was a problem hiding this comment.
Suggested change
| # connection and asynchronously upgrades it to a higher-priority node. | |
| # connection and asynchronously upgrades it to a higher-priority host. |
| continue | ||
|
|
||
| # Item 8: a reader worker observed a writer change while | ||
| # some regions are inaccessible. No node thread may be |
Contributor
There was a problem hiding this comment.
Suggested change
| # some regions are inaccessible. No node thread may be | |
| # some regions are inaccessible. No host thread may be |
| "ClusterTopologyMonitor.ExceptionStartingHostMonitor", | ||
| self._cluster_id, host_info.host, e) | ||
|
|
||
| # Item 8: if node threads never verified a writer (e.g. it |
Contributor
There was a problem hiding this comment.
Suggested change
| # Item 8: if node threads never verified a writer (e.g. it | |
| # Item 8: if host threads never verified a writer (e.g. it |
| "ClusterTopologyMonitor.ExceptionStartingHostMonitor", | ||
| self._cluster_id, host_info.host, e) | ||
|
|
||
| # Item 8: if node threads never verified a writer (e.g. it |
Contributor
There was a problem hiding this comment.
This is the second Item 8 - is that intentional? If so may I suggest 8a and 8b as titles
| self._monitor._update_topology_cache(hosts) | ||
|
|
||
| # Item 8: signal a panic-mode exit only when some regions are | ||
| # inaccessible. In that case no node thread may be able to reach the |
Contributor
There was a problem hiding this comment.
Suggested change
| # inaccessible. In that case no node thread may be able to reach the | |
| # inaccessible. In that case no host thread may be able to reach the |
| # new writer to confirm it via get_writer_id_if_connected(), so a | ||
| # reader-observed writer change is the fastest way out of panic mode. | ||
| # When all regions are accessible we defer to the standard exit path | ||
| # (a node thread connecting to the new writer reports it directly), |
Contributor
There was a problem hiding this comment.
Suggested change
| # (a node thread connecting to the new writer reports it directly), | |
| # (a host thread connecting to the new writer reports it directly), |
| def prepare_conn_props(self, props: Properties): | ||
| ... | ||
|
|
||
| def filter_available_hosts( |
Contributor
There was a problem hiding this comment.
Similar comment to my previous review: I'm curious about the best location for this logic - seems to be quite a bit of duplicated logic around filtering available hosts
| | [GDB Failover plugin](./UsingTheGdbFailoverPlugin.md) | Validates the home region at init. In `strict-writer` mode, **fails loudly** (`FailoverFailedError`) if the new writer is in an inaccessible region. In all other modes, filters out inaccessible-region hosts before candidate selection. | | ||
| | [GDB Read/Write Splitting plugin](./UsingTheGdbReadWriteSplittingPlugin.md) | Validates the home region at init. Rejects (`ReadWriteSplittingError`) a writer in an inaccessible region. Filters readers by accessible region **before** applying the home-region restriction. | | ||
| | Aurora Initial Connection Strategy plugin | Excludes inaccessible-region hosts before selecting a host by strategy. | | ||
| | Global Aurora topology monitor | Skips node-monitoring workers for hosts in inaccessible regions, and fails if the initial host is itself in an inaccessible region. | |
Contributor
There was a problem hiding this comment.
Suggested change
| | Global Aurora topology monitor | Skips node-monitoring workers for hosts in inaccessible regions, and fails if the initial host is itself in an inaccessible region. | | |
| | Global Aurora topology monitor | Skips host-monitoring workers for hosts in inaccessible regions, and fails if the initial host is itself in an inaccessible region. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gdb_accessible_regions)monitoring_connection_priority,gdb_monitoring_connection_priority)Description
GdbFailoverPlugin— failover candidates are filtered by accessible regions. In strict-writer mode, failover fails fast if the writer is in a non-accessible region.GdbReadWriteSplittingPlugin— writer connections to non-accessible regions are rejected. Reader candidates are filtered before applying home-region restrictions.GlobalAuroraTopologyMonitor— topology monitoring host workers skip non-accessible regions. The initial host's region is validated and the monitor fails fast if it is not accessible. When the writer is unreachable, the monitor exits panic mode by adopting harvested reader connections (stable-reader-topology consensus).AuroraInitialConnectionStrategyPlugin— host candidates are filtered by accessible regions before strategy-based selection. Filtering is delegated to the dialect viaDatabaseDialect.filter_available_hosts(hosts, accessible_regions), which is a no-op for non-Global dialects and an actual region filter forGlobalAuroraMysqlDialectandGlobalAuroraPgDialect.Both
GdbFailoverPluginandGdbReadWriteSplittingPluginvalidate at initialization that the configured home region is included in the accessible regions list when both are specified.New configuration parameter
monitoring_connection_priorityComma-separated ordered list of priorities for the topology monitoring connection:
strict-writer,strict-reader,writer-or-reader. Default isstrict-writer. The monitor accepts any connection initially and asynchronously upgrades to a higher-priority host without blocking the monitoring loop.New configuration parameter
gdb_monitoring_connection_priorityGDB-specific extension supporting region-aware values:
strict-writer-primary,strict-reader-primary,strict-reader-secondary,strict-writer-<region>,strict-reader-<region>, and plain<region>(any host in that region). Default isstrict-writer-primary.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.