Skip to content

[BugFix] Avoid redundant latestSnapshot() call in PaimonMetadata#getTableVersionRange (backport #72892) - #73121

Merged
wanpengfei-git merged 2 commits into
branch-3.5from
mergify/bp/branch-3.5/pr-72892
May 12, 2026
Merged

[BugFix] Avoid redundant latestSnapshot() call in PaimonMetadata#getTableVersionRange (backport #72892)#73121
wanpengfei-git merged 2 commits into
branch-3.5from
mergify/bp/branch-3.5/pr-72892

Conversation

@mergify

@mergify mergify Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

What I'm doing:

Fixes #72891

Duplicate latestSnapshot() in the same method

In PaimonMetadata.getRemoteFileInfos() (source):

long latestSnapshotId = -1L;
try {
    if (paimonTable.getNativeTable().latestSnapshot().isPresent()) {       // ← 1st S3 call
        latestSnapshotId = paimonTable.getNativeTable().latestSnapshot().get().id();  // ← 2nd S3 call!
    }
} catch (Exception e) { ... }

latestSnapshot() internally calls SnapshotManager.latestSnapshot()latestSnapshotFromFileSystem() → reads the S3 LATEST hint file every time. The result is never stored in a local variable.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

…#getTableVersionRange (#72892)

(cherry picked from commit 0340ccd)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/connector/paimon/PaimonMetadata.java
@mergify mergify Bot added the conflicts label May 11, 2026
@mergify

mergify Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of 0340ccd has failed:

On branch mergify/bp/branch-3.5/pr-72892
Your branch is up to date with 'origin/branch-3.5'.

You are currently cherry-picking commit 0340ccd57b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   fe/fe-core/src/main/java/com/starrocks/connector/paimon/PaimonMetadata.java

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify

mergify Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

@mergify[bot]: Backport conflict, please reslove the conflict and resubmit the pr

@kevincai kevincai self-assigned this May 12, 2026
@kevincai kevincai reopened this May 12, 2026
@wanpengfei-git
wanpengfei-git enabled auto-merge (squash) May 12, 2026 02:33
@kevincai

Copy link
Copy Markdown
Contributor

@copilot fix the backport code conflict, ensure only the necessary code from main branch back ported to the target 3.5 branch.

@kevincai kevincai changed the title [Enhancement] Avoid redundant latestSnapshot() call in PaimonMetadata#getTableVersionRange (backport #72892) [BugFix] Avoid redundant latestSnapshot() call in PaimonMetadata#getTableVersionRange (backport #72892) May 12, 2026
Agent-Logs-Url: https://github.com/StarRocks/starrocks/sessions/f7b819e7-7ac8-4970-843a-a1fddb40b31d

Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
auto-merge was automatically disabled May 12, 2026 02:43

Head branch was pushed to by a user without write access

Copilot AI commented May 12, 2026

Copy link
Copy Markdown
Contributor

@copilot fix the backport code conflict, ensure only the necessary code from main branch back ported to the target 3.5 branch.

Fixed in 3782b3f. The backport now removes the accidental conflict block and keeps only the intended latestSnapshot() caching change in branch-3.5.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • mirror.iscas.ac.cn
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/starrocks/starrocks/fe org.codehaus.plexus.classworlds.launcher.Launcher -pl fe-core -am -DskipTests -Dcheckstyle.skip=true compile (dns block)
  • repository.cloudera.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/starrocks/starrocks/fe org.codehaus.plexus.classworlds.launcher.Launcher -pl fe-core -am -DskipTests -Dcheckstyle.skip=true compile (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/starrocks/starrocks/fe org.codehaus.plexus.classworlds.launcher.Launcher -pl fe-core -am -DskipTests -Dcheckstyle.skip=true compile rgo/bin/git (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/starrocks/starrocks/fe org.codehaus.plexus.classworlds.launcher.Launcher -pl fe-core -am -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest=PaimonMetadataTest test (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@wanpengfei-git
wanpengfei-git enabled auto-merge (squash) May 12, 2026 02:44
Copilot AI requested a review from kevincai May 12, 2026 02:45
@wanpengfei-git
wanpengfei-git merged commit 7247367 into branch-3.5 May 12, 2026
42 of 45 checks passed
@wanpengfei-git
wanpengfei-git deleted the mergify/bp/branch-3.5/pr-72892 branch May 12, 2026 11:49
@trueeyu

trueeyu commented May 18, 2026

Copy link
Copy Markdown
Contributor

@mergify backport branch-3.5-cc

@mergify

mergify Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

backport branch-3.5-cc

✅ Backports have been created

Details

wanpengfei-git pushed a commit that referenced this pull request May 18, 2026
…ableVersionRange (backport #72892) (backport #73121) (#73430)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: haoyuhua <haoyuhua007@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kevincai <771299+kevincai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants