Skip to content
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 7 commits into from
Aug 8, 2024

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Aug 6, 2024

Fixes #320
Fixes #372

Related to #303

This will also fix the following Quarkus issue: quarkusio/quarkus#40151

@Ladicek
Copy link
Contributor Author

Ladicek commented Aug 6, 2024

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 Ladicek changed the title Cluster sentinel improvements Cluster and sentinel improvements Aug 6, 2024
@Ladicek Ladicek force-pushed the cluster-sentinel-improvements branch from bb5b302 to 9d5212e Compare August 7, 2024 13:19
@Ladicek Ladicek marked this pull request as ready for review August 7, 2024 13:27
@Ladicek
Copy link
Contributor Author

Ladicek commented Aug 7, 2024

Documentation done and TODO in the test resolved.

@Ladicek Ladicek force-pushed the cluster-sentinel-improvements branch 2 times, most recently from cc38de6 to a111300 Compare August 7, 2024 15:17
Ladicek added 7 commits August 8, 2024 10:33
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 Ladicek force-pushed the cluster-sentinel-improvements branch from a111300 to 551c966 Compare August 8, 2024 08:37
@Ladicek Ladicek added this to the 5.0.0 milestone Aug 8, 2024
@Ladicek Ladicek merged commit 144bf7b into vert-x3:master Aug 8, 2024
4 checks passed
@Ladicek Ladicek deleted the cluster-sentinel-improvements branch August 8, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant