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

Refactor cluster error handling #844

Merged
merged 6 commits into from
May 31, 2023
Merged

Conversation

jaymell
Copy link
Contributor

@jaymell jaymell commented May 19, 2023

This make some changes to how errors are handled in the redis cluster clients, most notably:

  • Remove exclusions -- in practice, exclusions create a lot of unnecessary connection rebuilding/slot refreshes when a failed command results in a MOVED error.
  • Attempt to refresh failed connections when IO errors occur instead of adding exclusions and ultimately refreshing slots due to the above-described scenario
  • Only retry given a subset of error types, otherwise return error immediately.

Copy link
Contributor

@nihohit nihohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a high-level review, I didn't go into each line.
I think it's a great change, I'll be happy to see it land soon.

redis/tests/support/mock_cluster.rs Show resolved Hide resolved
redis/src/cluster_routing.rs Outdated Show resolved Hide resolved
redis/src/types.rs Show resolved Hide resolved
Copy link
Contributor

@nihohit nihohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a high-level review, I didn't go into each line.
I think it's a great change, I'll be happy to see it land soon.

@jaymell jaymell force-pushed the no-exclusions branch 3 times, most recently from ebda2c7 to 7751c0f Compare May 23, 2023 05:48
@jaymell jaymell marked this pull request as ready for review May 23, 2023 05:59
Copy link
Contributor

@nihohit nihohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. mostly minor comments.

redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/types.rs Outdated Show resolved Hide resolved
redis/src/types.rs Show resolved Hide resolved
redis/tests/test_cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@nihohit nihohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. mostly minor comments.

This make some changes to how errors are handled in the
redis cluster clients, most notably:
* Remove exclusions -- in practice, exclusions create a lot of
  unnecessary connection rebuilding/slot refreshes when a failed command results
  in a `MOVED` error.
* Attempt to refresh failed connections when IO errors occur instead of
  adding exclusions and ultimately refreshing slots due to the above-described
  scenario
* Only retry given a subset of error types, otherwise return error immediately.
redis/src/cluster_routing.rs Outdated Show resolved Hide resolved
redis/src/types.rs Show resolved Hide resolved
@nihohit
Copy link
Contributor

nihohit commented May 31, 2023

LGTM

@jaymell jaymell merged commit ee6e4da into redis-rs:main May 31, 2023
9 checks passed
@jaymell jaymell deleted the no-exclusions branch May 31, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants