-
Notifications
You must be signed in to change notification settings - Fork 1
Fix crash recovery #29
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
Merged
Merged
Conversation
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
2cfe41b to
da48675
Compare
075c017 to
d3d8dda
Compare
da48675 to
319fe6c
Compare
Move the pending batch check to BEFORE fetching a new batch from the stream. Previously, after a reorg was detected: 1. The data batch was stored as _pending_batch 2. A reorg batch was returned 3. On next __next__() call, a NEW batch was fetched BEFORE checking _pending_batch 4. This caused the pending batch to be lost or returned out of order Now the pending batch check happens first, ensuring proper ordering: reorg_batch -> pending_data_batch -> next_batch
On stream start, automatically clean up any data written after the last checkpoint watermark. This handles crash scenarios where data was written but the checkpoint was not saved. The _rewind_to_watermark method: 1. Gets the last watermark from state store 2. Creates invalidation ranges for blocks after the watermark 3. Calls _handle_reorg to delete uncommitted data 4. Falls back gracefully if loader does not support deletion Called automatically at start of load_stream_continuous once per table.
319fe6c to
9217d23
Compare
deaa9d1 to
ffa520e
Compare
fordN
reviewed
Feb 3, 2026
|
|
||
| connection_name = kwargs.get('connection_name') | ||
| if connection_name is None: | ||
| connection_name = self.loader_type |
Contributor
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.
Nice, this can provide more helpful connection names.
fordN
approved these changes
Feb 3, 2026
- Make table_name required instead of Optional (matches actual usage) - Remove unnecessary list scaffolding since callers always provide single table - Include hash/prev_hash in invalidation range for potential validation - Remove test for table_name=None case
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.
No description provided.