DoUntilQuorum
: don't use non-zone-aware logging when all zones are required for quorum
#403
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.
What this PR does:
This PR fixes an issue where
DoUntilQuorum
may generate more log messages and span events than expected when zone-awareness is enabled but all healthy zones are required for quorum. (For example, zone-awareness is enabled, three zones are running with 100 instances each, but one instance in the first zone is unavailable, so all instances in the other two zones are required for quorum.)Previously, if zone-awareness was enabled and all healthy zones were required for quorum, both
ReplicationSet.MaxErrors
andReplicationSet.MaxUnavailableZones
would be 0.DoUntilQuorum
would then default to non-zone-aware mode. In non-zone-aware mode,DoUntilQuorum
logs astarting request to instance
message for every instance.In contrast, in zone-aware mode,
DoUntilQuorum
logs astarting requests to zone
message for each unique zone.In the example above, with all instances healthy,
DoUntilQuorum
would log two or threestarting requests to zone
messages, but as soon as one instance becomes unhealthy, a subsequentDoUntilQuorum
call would log 200starting request to instance
messages.This PR changes the behaviour of
DoUntilQuorum
to always run in zone-aware mode if zone-awareness is enabled, even if bothReplicationSet.MaxErrors
andReplicationSet.MaxUnavailableZones
are 0.Which issue(s) this PR fixes:
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]