zhaohaidao commented on code in PR #189:
URL: https://github.com/apache/fluss-rust/pull/189#discussion_r2719401170
##########
crates/fluss/src/client/table/scanner.rs:
##########
@@ -570,6 +571,16 @@ impl LogFetcher {
}
}
+ fn should_invalidate_bucket_leader(error: FlussError) -> bool {
+ matches!(
+ error,
+ FlussError::NotLeaderOrFollower
+ | FlussError::LeaderNotAvailableException
+ | FlussError::FencedLeaderEpochException
+ | FlussError::UnknownTableOrBucketException
Review Comment:
Good catch!
##########
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:
makes sense.
--
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]