-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ENH] Clean up client manager into manager/assigner - make log client use it #4640
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
1 similar comment
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
@@ -69,7 +69,7 @@ tokio = { version = "1.41", features = ["fs", "macros", "rt-multi-thread"] } | |||
tokio-util = "0.7.12" | |||
tonic = "0.12" | |||
tonic-health = "0.12.3" | |||
tower = "0.5" | |||
tower = { version = "0.4.13", features = ["discover"] } |
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.
Some users of this were on an older version and depend on it, keep that version for now.
let client_manager = ClientManager::new( | ||
node_name_to_client.clone(), | ||
client_assigner.clone(), | ||
config.connections_per_node, |
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.
I will move these other config into the ClientOptions
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.
will address in another PR
.collection_id | ||
.to_string(), | ||
) | ||
.map_err(|e| ExecutorError::Internal(e.boxed()))?; |
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.
Forced to box this error due to a cyclic dep since ExecutorError is in types and the crate that defines this error depends on types
let client_assigner = ClientAssigner::new(assignment_policy, 1); | ||
let client_manager = ClientManager::new( | ||
client_assigner.clone(), | ||
1, |
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.
replication factor is always one for log
} else { | ||
None | ||
|
||
// Alt client manager setup |
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.
This could be made a bit cleaner, will leave that for another pr since the other use already did it this way
rust/log/src/grpc_log.rs
Outdated
memberlist_provider.subscribe(client_manager_handle.receiver()); | ||
let _memberlist_provider_handle = system.start_component(memberlist_provider); | ||
|
||
// let alt_client = if let Some(alt_host) = my_config.alt_host.as_ref() { |
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.
will remove
rust/log/src/grpc_log.rs
Outdated
.unwrap_or_default() | ||
.drain(..) | ||
.next() | ||
// fallback to the standard client if no alt client is available, |
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.
this is a temporary choice, when we remove alt client we can remove this
rust/log/src/grpc_log.rs
Outdated
} | ||
} | ||
tracing::info!("using standard client for {collection_id}"); | ||
&mut self.client | ||
self.client.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.
grpc client clones are cheap
}, | ||
) | ||
.await | ||
let mut combined_response = Vec::new(); |
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.
Please ensure this is correct
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.
This looks correct to me. I read it twice over.
Major Refactor: Client Manager Abstraction, Memberlist Integration, & System Hydration Cleanup This PR significantly refactors and centralizes client (gRPC) management logic for both the distributed executor and log components by introducing a generic, reusable Key Changes: Affected Areas: Potential Impact: Functionality: Should improve reliability and flexibility in rolling out new node membership, assignment policies, and dynamic membership scenarios for both log and query services. Removes old system hydration footguns. Performance: No expected regression; centralization could improve efficiency, but extra indirection may have minor effect. gRPC client Security: No direct security changes, but more robust system wiring and centralized error paths could reduce some edge error handling flaws. Scalability: Enables more robust scaling with clean assignment and memberlist policy swapping. Generalizes client replica management and flexibility. Review Focus: Testing Needed• Ensure that all tests pass and that membership changes propagate correctly to clients in log and executor paths. Code Quality Assessmentrust/memberlist/src/client_manager.rs: High complexity, but clearly structured; heavy use of generics and trait bounds is correctly applied. rust/log/src/grpc_log.rs: Now cleaner with manager/assigner usage; alt client handing more robust but could use future cleanup. rust/frontend/src/executor/distributed.rs: Greatly simplified, clearer separation of assignment vs. concrete GRPC client handling. rust/worker/src/compactor/compaction_manager.rs: Simplified system wiring, less boilerplate and set_system/set_dispatcher hacks. Cargo.toml/Cargo.lock: Workspace improvements and dependency pinning all look correct for new crate structure. Best PracticesDependency Injection: Error Handling: Testing: Configuration: Abstraction: Potential Issues• If any user relies on direct low-level node_name-to-client manipulation, those code paths will now be broken. This summary was automatically generated by @propel-code-bot |
fn new_from_channel(channel: GrpcTraceService<Channel>) -> Self { | ||
QueryExecutorClient::new(channel) | ||
} | ||
fn max_decoding_message_size(self, max_size: usize) -> Self { |
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.
I'm surprised this works with a trait, but I guess it works only on concrete types.
}, | ||
) | ||
.await | ||
let mut combined_response = Vec::new(); |
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.
This looks correct to me. I read it twice over.
Description of changes
Summarize the changes made by this PR.
set_system
pattern in lieu of passing system into try_from_config - aligning with the common. pattern since we touched thisTest plan
How are these changes tested?
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
None