feat(lance): support checkpointed append commits#16
Open
everySympathy wants to merge 1 commit into
Open
Conversation
54d97ab to
3f0cfb0
Compare
3f0cfb0 to
3782bbf
Compare
3782bbf to
3c2f099
Compare
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.
Related issue: Eventual-Inc/Daft#6967
Summary
This PR adds checkpoint-aware append commit support for
write_lance.The goal is to make Lance append writes recoverable when Daft source checkpointing is enabled.
The key recovery problem is that, on retry, Daft may skip source rows that were already checkpointed. That means the retry run may not produce all current-run
write_resultsagain. For Lance, thosewrite_resultscontain the fragment metadata that still needs to be appended to the Lance table.This PR makes
daft_lancerecover stagedwrite_resultsfrom the checkpoint store duringfinalize(), then commit the recovered fragments through a Lance append transaction.Implementation
This PR adds:
checkpointparameter toLanceDataSink.mode="append"is supported.checkpoint_file_format(), so Daft core knows this DataSink wants its per-inputwrite_resultsstaged in the checkpoint store.CheckpointStoreis not sent to workers;finalize().finalize()recovery logic:write_resultsfrom the checkpoint store;write_results;lance.TransactionandLanceOperation.Append;mark_committed()after the Lance commit succeeds.The Lance-specific recovery logic intentionally lives in
daft_lance. Daft core only stages opaquewrite_results; it does not need to understand LanceFragmentMetadata.Scope
This PR currently supports append only.
Not supported yet:
mode="create"mode="overwrite"mode="merge"Those modes have different recovery semantics and should be designed separately.
Testing
Unit tests cover:
checkpoint_file_format()opt-in for Lance checkpoint metadata staging.write_resultsfrom checkpoint metadata.mark_committed()fails.Ray end-to-end tests cover:
mark_committedcrash window;Manual validation:
read_parquet -> write_lanceon a Ray cluster.Committed.