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

[4.x] Cluster and sentinel improvements #460

Merged
merged 7 commits into from
Aug 8, 2024

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Aug 7, 2024

Backport of #459 to 4.x

Ladicek added 7 commits August 7, 2024 16:32
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 added this to the 4.5.10 milestone Aug 7, 2024
@Ladicek Ladicek changed the base branch from master to 4.x August 7, 2024 15:25
@Ladicek Ladicek merged commit 401a3d6 into vert-x3:4.x Aug 8, 2024
1 check passed
@Ladicek Ladicek deleted the cluster-sentinel-improvements-4.x 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
Development

Successfully merging this pull request may close these issues.

1 participant