-
Notifications
You must be signed in to change notification settings - Fork 191
RUST-2310 Deprioritize servers in server selection for all topologies #1576
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
base: main
Are you sure you want to change the base?
Conversation
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.
A lot of the changes in this file are just shuffling things around; the functional changes are based on this diff from the spec PR.
| topology_description: &'a TopologyDescription, | ||
| servers: &'a HashMap<ServerAddress, Arc<Server>>, | ||
| deprioritized: Option<&ServerAddress>, | ||
| deprioritized: &[&ServerAddress], |
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.
Made this a list in anticipation of CSOT and because the tests use lists of multiple addresses.
abr-egn
left a comment
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! Some very small questions, no need for a re-review.
| fn suitable_servers( | ||
| fn filter_servers_in_replica_set<'a>( | ||
| &self, | ||
| servers: impl Iterator<Item = &'a ServerDescription> + Clone, |
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.
Why not just &[&'a ServerDescription]?
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.
filter_servers_by_selection_criteria (which calls this) already has an iterator with the deprioritized servers filtered out, so accepting that directly allows us to avoid an intermediary structure
driver/src/client.rs
Outdated
| #[allow(unused_variables)] // we only use the operation_name for tracing. | ||
| operation_name: &str, | ||
| deprioritized: Option<&ServerAddress>, | ||
| deprioritized: Vec<&ServerAddress>, |
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.
Likewise, it doesn't seem like this needs to be owned?
|
not sure why but this is still requiring re-approval |
RUST-2310