fix: allow read-only operations when all masters are down#497
Open
p0rtale wants to merge 1 commit into
Open
Conversation
a489998 to
427fc6a
Compare
Read-only operations (get, select, count, min, max) used to fail with connection errors if all masters in the cluster were unavailable, even when healthy replicas were up and failover hadn't processed yet. To resolve this, the following improvements were made: - Introduced a `read_only` flag to `utils.get_space[s]` to fetch cluster schema from any healthy replica if masters are down. - Updated `get`, `select`, `count`, `min`, `max` to use this new flag. - Rewrote `call.any` to iterate through all replicasets and utilize vshard's `callro` instead of `call` to fetch metadata from replicas.
427fc6a to
c93121e
Compare
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.
Read-only operations (get, select, count, min, max) used to fail with connection errors if all masters in the cluster were unavailable, even when healthy replicas were up and failover hadn't processed yet.
To resolve this, the following improvements were made:
read_onlyflag toutils.get_space[s]to fetch cluster schema from any healthy replica if masters are down.get,select,count,min,maxto use this new flag.call.anyto iterate through all replicasets and utilize vshard'scallroinstead ofcallto fetch metadata from replicas.Closes TNTP-7102