This is an automated email from the ASF dual-hosted git repository.

jark pushed a commit to branch release-0.8
in repository https://gitbox.apache.org/repos/asf/fluss.git

commit 7e620e3dc58f482c22ced3d548af088927c6b9d1
Author: yunhong <[email protected]>
AuthorDate: Thu Oct 30 15:25:59 2025 +0800

    [hotfix][client] Fix potential metadata inconsistency by deduplicating 
getBucketLocation call (#1897)
    
    (cherry picked from commit 31a9352bd091353c8d3b06f6523e5af382eba8fa)
---
 .../java/org/apache/fluss/client/table/scanner/log/LogFetcher.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetcher.java
 
b/fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetcher.java
index ff67575e2..f2df66aaa 100644
--- 
a/fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetcher.java
+++ 
b/fluss-client/src/main/java/org/apache/fluss/client/table/scanner/log/LogFetcher.java
@@ -65,6 +65,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
@@ -502,8 +503,9 @@ public class LogFetcher implements Closeable {
     }
 
     private Integer getTableBucketLeader(TableBucket tableBucket) {
-        if (metadataUpdater.getBucketLocation(tableBucket).isPresent()) {
-            BucketLocation bucketLocation = 
metadataUpdater.getBucketLocation(tableBucket).get();
+        Optional<BucketLocation> bucketLocationOpt = 
metadataUpdater.getBucketLocation(tableBucket);
+        if (bucketLocationOpt.isPresent()) {
+            BucketLocation bucketLocation = bucketLocationOpt.get();
             if (bucketLocation.getLeader() != null) {
                 return bucketLocation.getLeader();
             }

Reply via email to