-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster and sentinel improvements #459
Merged
Merged
Conversation
This file contains 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
This is a draft because more documentation is needed and there's one TODO in one of the tests, otherwise this should be ready. |
Ladicek
changed the title
Cluster sentinel improvements
Cluster and sentinel improvements
Aug 6, 2024
Ladicek
force-pushed
the
cluster-sentinel-improvements
branch
from
August 7, 2024 13:19
bb5b302
to
9d5212e
Compare
Documentation done and TODO in the test resolved. |
Ladicek
force-pushed
the
cluster-sentinel-improvements
branch
2 times, most recently
from
August 7, 2024 15:17
cc38de6
to
a111300
Compare
For `REPLICA` and `SENTINEL` roles, as well as for the `MASTER` role when automatic failover is disabled, once the initial connection is established, the connection operation is complete. A secondary connection to a sentinel node is useless in this case, so it is skipped. This is much simpler and lighter than before, while no functionality is lost or changed. For the `MASTER` role with automatic failover enabled, we no longer create a secondary connection to a sentinel node for every connection attempt. Instead, we create one connection to a sentinel node and use it to trigger failover for all created connections.
Note that this fix only applies to situations where no new node is added to the cluster. If a new, previously unknown node is added, an error is still propagated to the caller.
The `RedisClusterClient` contains a single instance of `SharedSlots`, which is also shared between all connections created by this client. This means that when a `MOVED` redirection is obtained, slots are invalidated not only for subsequently created connections, but also for all existing connections. This commit also moves the code for obtaining the hash slot assignment to the `SharedSlots` class.
- improve how the container readiness is established - added the ability to start a new master in the container
Redirections to existing nodes are handled already.
Ladicek
force-pushed
the
cluster-sentinel-improvements
branch
from
August 8, 2024 08:37
a111300
to
551c966
Compare
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.
Fixes #320
Fixes #372
Related to #303
This will also fix the following Quarkus issue: quarkusio/quarkus#40151