Skip to content

[lake/paimon] Skip readable snapshot recomputation when latest compacted snapshot already in ZK#2640

Merged
wuchong merged 1 commit intoapache:mainfrom
luoyuxia:optimize-get-readablesnapshot
Feb 12, 2026
Merged

[lake/paimon] Skip readable snapshot recomputation when latest compacted snapshot already in ZK#2640
wuchong merged 1 commit intoapache:mainfrom
luoyuxia:optimize-get-readablesnapshot

Conversation

@luoyuxia
Copy link
Contributor

@luoyuxia luoyuxia commented Feb 11, 2026

Purpose

Linked issue: close #2626

Optimize readable snapshot computation performance: skip redundant tiered and readable offset recalculation when the latest compacted snapshot is already registered in Fluss (ZK). This avoids expensive recomputation when multiple APPEND snapshots follow a single COMPACT snapshot.

Brief change log

  • Add ZK lookup logic in DvTableReadableSnapshotRetriever.computeReadableSnapshotAndOffsets()
  • Return null directly if compacted snapshot already exists in ZK (no update needed)

Tests

  • Add test case to verify that getReadableSnapshotAndOffsets() correctly returns null when compacted snapshot is already registered in ZK
  • Existing tests continue to verify the normal flow

N/A

API and Format

N/A

Documentation

N/A

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce redundant work in the Paimon DV readable-snapshot resolution by skipping recomputation when the latest compacted snapshot is already registered in Fluss (ZK), and adds a unit test to cover the new behavior.

Changes:

  • Add a Fluss (ZK) lookup for the latest compacted snapshot and early-return when it is already present.
  • Update method JavaDoc to document the new short-circuit behavior.
  • Extend the existing readable-snapshot retriever test to assert the “skip recomputation” case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
fluss-lake/fluss-lake-paimon/src/main/java/org/apache/fluss/lake/paimon/utils/DvTableReadableSnapshotRetriever.java Adds ZK/Fluss snapshot existence check and returns null to skip recomputation when present.
fluss-lake/fluss-lake-paimon/src/test/java/org/apache/fluss/lake/paimon/utils/DvTableReadableSnapshotRetrieverTest.java Adds a test scenario expecting null when the latest compacted snapshot is already registered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@luoyuxia luoyuxia force-pushed the optimize-get-readablesnapshot branch from b440cbe to 0a9468e Compare February 11, 2026 07:39
@luoyuxia
Copy link
Contributor Author

@wuchong I submit a pr to skip readable snapshot recomputation when the latest compacted snapshot is already registered in Fluss (ZK) for paimon deletion vector table. Could you please help review?

@wuchong wuchong merged commit 5fd8d9c into apache:main Feb 12, 2026
6 checks passed
wuchong pushed a commit that referenced this pull request Feb 12, 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.

Optimize commit readable snapshot in tiering service

2 participants