-
Notifications
You must be signed in to change notification settings - Fork 635
[lake/paimon] Explictly snapshotId setting to improve scan-based lookup performance #4480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -373,7 +373,8 @@ private LookupContext createLookupContext( | |
| lakeBucketId, | ||
| (short) schemaInfo.getSchemaId(), | ||
| schemaInfo.getSchema().getRowType(), | ||
| lookupMetricRecorder); | ||
| lookupMetricRecorder, | ||
| requiredLakeSnapshotIds.get(tableInfo.getTableId())); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all the modification origins from the fluss, so this won't happen
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a stale-snapshot case here even when the context and
This can happen even while SST avoids this particular case because its file cache is keyed by the original partition and bucket. On the first lookup of Could we address this case so that SCAN does not remain pinned to a snapshot that predates the queried partition’s tiered data?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice catch, this is uncovered (described into the following first case) in the current PR. I think we should distinguish two cases: Data written before the regular partition expires.The data is written through the regular bucket and committed in S2. The historical bucket may have no progress in that commit, so its lookup manager can remain on S1. When the regular partition expires, its existing rows are not copied into the historical bucket’s local KV. The first historical lookup therefore falls back to S1 and can miss the data. This is the gap you pointed out, and making snapshot capture and acquire atomic would not fix it. For this case, I’ll make partition expiration trigger a refresh of the historical lookup manager’s cached snapshot to the latest version. This relies on the guarantee established by #3820 that the partition’s data has been fully tiered to the lake before expiration. I’ll include this fix in the current PR. Updates or deletes written after the partition has expired.Updates and deletes to expired partitions go through the historical bucket. Local values and deletion markers take priority over lake data. After tiering, the snapshot is updated before local state can be cleaned up. so for this case, there is no correctness risk for the cached expired snapshotId (that may be delayed updated with a potential async updating interval) |
||
| return new LookupContext( | ||
| tableInfo.getTableId(), schemaInfo.getSchemaId(), tablePath, lookupContext); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove this test-only overload? The tests can call the six-argument constructor directly and pass
nullwhen the lake snapshot is unknown.