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

Topology refresh changes #8

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

barshaul
Copy link

@barshaul barshaul commented Jul 20, 2023

Changed refresh_slots to run with retries and query multiple nodes and return the most frequent topology.

@barshaul barshaul requested a review from nihohit July 20, 2023 07:54
@barshaul barshaul marked this pull request as ready for review July 20, 2023 07:54
Copy link

@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.

first round

redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
if idx == topology_vec.len() - 1 {
return Err(e);
} else {
continue;
Copy link

Choose a reason for hiding this comment

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

so, while we want to use the best view, we're fine with using a view that is held by the minority of nodes?

Copy link
Author

Choose a reason for hiding this comment

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

If it's the last retry AND we still couldn't find a majority, yes, we will be ok by taking a view with full coverage

redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/tests/test_cluster_async.rs Outdated Show resolved Hide resolved
@barshaul barshaul force-pushed the refresh_topology branch 3 times, most recently from 744ab15 to fbbb9df Compare July 24, 2023 07:46
@barshaul
Copy link
Author

@nihohit Finished first round

Copy link

@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.

Fix & Squash

redis/Cargo.toml Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
redis/src/cluster_topology.rs Outdated Show resolved Hide resolved
@barshaul barshaul force-pushed the refresh_topology branch 2 times, most recently from adba2d6 to 24475ae Compare July 26, 2023 08:29
redis/Cargo.toml Outdated Show resolved Hide resolved
@barshaul
Copy link
Author

@nihohit Ready for review: two last commits, addressing your last comments and added retries.

redis/Cargo.toml Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Show resolved Hide resolved
redis/Cargo.toml Outdated Show resolved Hide resolved
redis/src/cluster_async/mod.rs Outdated Show resolved Hide resolved
Ok(())
}
}

// Query a node to discover slot-> master mappings
async fn refresh_slots(inner: Arc<InnerCore<C>>, curr_retry: usize) -> RedisResult<()> {
Copy link

Choose a reason for hiding this comment

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

sadly, the diff isn't there. Did something change in the logic here?

Copy link
Author

Choose a reason for hiding this comment

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

nope, only changed it to get curr_retry: usize instead of AtomicUsize

redis/tests/test_cluster_async.rs Outdated Show resolved Hide resolved
@barshaul
Copy link
Author

barshaul commented Aug 2, 2023

@nihohit round

@barshaul barshaul force-pushed the refresh_topology branch 2 times, most recently from 1bf7465 to 2f71bcd Compare August 3, 2023 07:22
Copy link

@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.

minor comments

redis/tests/test_cluster_async.rs Outdated Show resolved Hide resolved
redis/tests/test_cluster_async.rs Outdated Show resolved Hide resolved
@nihohit nihohit merged commit dbc0c4e into amazon-contributing:main Aug 3, 2023
9 checks passed
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.

2 participants