Skip to content

[hotfix][client] Fix potential metadata inconsistency by deduplicating getBucketLocation call#1897

Merged
loserwang1024 merged 1 commit into
apache:mainfrom
swuferhong:get-table-bucket-fix
Oct 30, 2025
Merged

[hotfix][client] Fix potential metadata inconsistency by deduplicating getBucketLocation call#1897
loserwang1024 merged 1 commit into
apache:mainfrom
swuferhong:get-table-bucket-fix

Conversation

@swuferhong

Copy link
Copy Markdown
Contributor

Purpose

This pr is aims to fix the NoSuchElementException throw at client when upgrading cluster:

image

Brief change log

Tests

API and Format

Documentation

private Integer getTableBucketLeader(TableBucket tableBucket) {
if (metadataUpdater.getBucketLocation(tableBucket).isPresent()) {
BucketLocation bucketLocation = metadataUpdater.getBucketLocation(tableBucket).get();
Optional<BucketLocation> bucketLocationOpt = metadataUpdater.getBucketLocation(tableBucket);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, here we want to call metadataUpdater.getBucketLocation once to make sure the status consistence. Could you change the commit message to [hotfix][client] Fix potential metadata inconsistency by deduplicating getBucketLocation call ?

Btw, we can also search similar places in client.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I have checked the callers of MetadataUpdater and confirmed that there are no other inconsistent invocations.

@loserwang1024 loserwang1024 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@swuferhong swuferhong force-pushed the get-table-bucket-fix branch from bce8643 to 73e7dbb Compare October 30, 2025 06:43
@swuferhong swuferhong changed the title [hotfix] Fix no value present exception when get table bucket leader in LogFetcher [hotfix][client] Fix potential metadata inconsistency by deduplicating getBucketLocation call Oct 30, 2025

@leonardBang leonardBang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @swuferhong for the update and check, LGTM

@loserwang1024 loserwang1024 merged commit 31a9352 into apache:main Oct 30, 2025
5 checks passed
swuferhong added a commit to swuferhong/fluss that referenced this pull request Oct 31, 2025
wuchong pushed a commit that referenced this pull request Nov 2, 2025
…g getBucketLocation call (#1897)

(cherry picked from commit 31a9352)
Ugbot pushed a commit to Ugbot/fluss that referenced this pull request Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants