Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Bugfix/fix move errors #477

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JonathanWylie
Copy link

@JonathanWylie JonathanWylie commented Aug 19, 2021

2 bug fixes here and a logging improvement and a testing improvement:
1/ Startup nodes were not being populated correctly when initialising the node manager.
2/ Handling of SlotNotCoveredError was raising the exception one attempt too early, before it had used all allowed TTL.
3/ When a command is executed and it succeeds it's nice not to have a bunch of error exception logs. Instead only log the exception if all attempts are used up, otherwise log a warning. It's useful to be able to differentiate between a command that failed fatally, and one that was ultimately successful, with perhaps some warnings about short lived problems along the way.
4/ It took me forever to work out what kind of cluster I need to run the tests against. It was fairly simple in the end, but I have included a docker_compose.yml file which can be used to start the redis cluster for the tests.

Could you could also give a rationale for picking a random node when a timeout error happens?
I am also curious as to what conditions it is trying to handle. Every time I have seen this in action, picking a different node, just results in a moved error, pointing the client back to the original node. So it's unclear to me why it doesn't just keep trying the correct node, instead of picking an incorrect node only to be redirect back.

Some errors are fatal, so we should log the exception.
Other errors we will try to handle and try again, in such a case
just log a warning unless it is the final attempt. This means
successful retries will not result in an exception being logged.
- SlotNotCoveredError, was re-raising the exception one attempt too soon.
- Similarly log_exception
populate_startup_nodes is meant to put all the known nodes in the startup nodes list,
but when it was called, the nodes list it was using (self.nodes) is not populated yet.
So populate startup nodes after initialising self.nodes,
otherwise when we choose a random connection (which is chosen from startup nodes),
the options are too limited. Often a user will specify a single startup node at the beginning.
Add a docker-compose.yml file configuring a redis cluster instance for running the tests against.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant