fresh-borzoni commented on code in PR #189:
URL: https://github.com/apache/fluss-rust/pull/189#discussion_r2712504511
##########
crates/fluss/src/cluster/cluster.rs:
##########
@@ -101,6 +101,31 @@ impl Cluster {
)
}
+ pub fn invalidate_bucket_leader(&self, table_bucket: &TableBucket) -> Self
{
+ let mut available_locations_by_bucket =
self.available_locations_by_bucket.clone();
+ available_locations_by_bucket.remove(table_bucket);
+
+ let mut available_locations_by_path =
self.available_locations_by_path.clone();
+ if let Some(table_path) =
self.table_path_by_id.get(&table_bucket.table_id()) {
+ if let Some(locations) =
available_locations_by_path.get_mut(table_path) {
+ locations.retain(|location| location.table_bucket() !=
table_bucket);
+ }
+ } else {
+ for locations in available_locations_by_path.values_mut() {
Review Comment:
It's defensive and good, but if `table_id` isn't in `table_path_by_id`, that
indicates some inconsistency and we hide some issues with this fallback.
Do we wish to add a warn here at least?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]