-
Notifications
You must be signed in to change notification settings - Fork 43
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
Retry when an async slotmap update fails #252
Open
bjosv
wants to merge
14
commits into
Nordix:master
Choose a base branch
from
bjosv:async-initial-update-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+291
−117
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
Treat an empty ip string as it means the same endpoint the current command was sent to, as described in docs. Signed-off-by: Björn Svensson <[email protected]>
Treat an empty ip string as it means the same endpoint the current command was sent to, as described in docs. Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Treat an empty ip string as it means the same endpoint the current command was sent to, as described in docs. Use the host address that is kept in the hiredis context. Signed-off-by: Björn Svensson <[email protected]>
Treat an empty ip string as it means the same endpoint the current command was sent to, as described in docs. Use the host address from the hiredis context. Remove duplicate validation of host and port elements. Signed-off-by: Björn Svensson <[email protected]>
The added flag --async-initial-update allows testcases to connect to the cluster using `redisClusterAsyncConnect2`, which will not block while performing the initial slotmap update. Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
…sync-initial-update-fix
Since timers are handled before filedescription events in libevent we will not give time to socket reads when sending multiple commands. Using a short time allows hiredis to read from sockets and avoids some unpredictability in tests. Signed-off-by: Björn Svensson <[email protected]>
"A NULL value for the endpoint indicates the node has an unknown endpoint and the client should connect to the same endpoint it used to send the CLUSTER SLOTS command but with the port returned from the command." Signed-off-by: Björn Svensson <[email protected]>
zuiderkwast
approved these changes
Jan 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 A question about
redisClusterAsyncConnect2()
and slot map updates #249 .Additional related corrections found while testing:
CLUSTER SLOTS
andCLUSTER NODES
responses.Treat an empty ip string as it means the same endpoint the current command was sent to, as described in docs.
Use the host address that is kept in the hiredis context.
This solves the problem that an empty address was accepted, despite connecting using and empty address will fail in the next slotmap update.
CLUSTER SLOTS
responses.Test improvements:
Add
connect-during-cluster-startup
tests.Two new tests were added to verify that the slotmap will be be updated until it succeed.
clusterclient_async
received a new flag--async-initial-update
to be able to connect toan cluster using
redisClusterAsyncConnect2
, which will not block while performing the initial slotmap update.Use short timeout when scheduling processing of next command in
clusterclient_async
.