Repository navigation
[Kernel] Remove SnapshotHint; Fix CRCInfo caching bug in LogReplay; Simplify LogReplay - #5276
Merged
scottsand-db merged 2 commits intoSep 30, 2025
Conversation
scottsand-db
commented
Sep 30, 2025
|
|
||
| /** Returns the CRC info persisted in the logSegment's lastSeenChecksum File */ | ||
| public Optional<CRCInfo> getLastSeenCrcInfo() { | ||
| if (!cachedLastSeenCrcInfo.isPresent()) { |
Collaborator
Author
There was a problem hiding this comment.
Bug! What if there is no CRC at version N? Then we will check the cache -- see that this is EMPTY -- and then try and load it! And then what happens if someone invokes this method again? Well, we will repeat the same load attempt!
This really just needed to be an Optional<Optional<CRCInfo>> or a Lazy<Optional<CRC<Info>>
scottsand-db
requested review from
allisonport-db,
huan233usc and
vkorukanti
September 30, 2025 20:21
vkorukanti
approved these changes
Sep 30, 2025
huan233usc
approved these changes
Sep 30, 2025
huashi-st
pushed a commit
to huashi-st/delta
that referenced
this pull request
Apr 24, 2026
…implify LogReplay (delta-io#5276) ## 🥞 Stacked PR Use this [link](https://github.com/delta-io/delta/pull/5276/files) to review incremental changes. - [**stack/kernel_remove_snapshot_hint**](delta-io#5276) [[Files changed](https://github.com/delta-io/delta/pull/5276/files)] --------- #### Which Delta project/connector is this regarding? - [ ] Spark - [ ] Standalone - [ ] Flink - [X] Kernel - [ ] Other (fill in here) ## Description This PR removes SnapshotHint. This was a legacy optimization -- in the future, we don't plan to have a persisted `Table` that holds on to cached information like previous snapshots. That should be done by the connector. While cleaning up SnapshotHint, I realized that we could significatintly simplify our CRCInfo logic and caching in LogReplay. I also noticed a bug where we were treating `Optional<CRCInfo>` as both (a) we have never checked to load the crcInfo at this version, and (b) there is no CRC info at this version. I've fixed that here by just using a `Lazy<Optional<CRCInfo>>` ## How was this patch tested? Just a refactor. Existing UTs. ## Does this PR introduce _any_ user-facing changes? No.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
Which Delta project/connector is this regarding?
Description
This PR removes SnapshotHint. This was a legacy optimization -- in the future, we don't plan to have a persisted
Tablethat holds on to cached information like previous snapshots. That should be done by the connector.While cleaning up SnapshotHint, I realized that we could significatintly simplify our CRCInfo logic and caching in LogReplay. I also noticed a bug where we were treating
Optional<CRCInfo>as both (a) we have never checked to load the crcInfo at this version, and (b) there is no CRC info at this version. I've fixed that here by just using aLazy<Optional<CRCInfo>>How was this patch tested?
Just a refactor. Existing UTs.
Does this PR introduce any user-facing changes?
No.