-
Notifications
You must be signed in to change notification settings - Fork 1k
Minor improvements to publishing #5089
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
Minor improvements to publishing #5089
Conversation
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.
Pull request overview
This PR improves checkpoint publishing robustness by handling edge cases where publishing is enabled mid-checkpoint. The changes refactor how incomplete checkpoints are detected and skipped, and relocate the corruption check to after the truncation process completes.
Key changes:
- Introduced
mPublishWasDisabledflag to track when publishing was previously disabled and skip incomplete checkpoints - Moved checkpoint file corruption detection to after truncation completes, avoiding false positives
- Changed corruption check from
!=to<to accommodate truncation scenarios - Enhanced error messages when checkpoint files are partially missing
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/history/CheckpointBuilder.h | Added publishWasDisabled() getter method and changed ensureOpen() return type from bool to void |
| src/history/CheckpointBuilder.cpp | Refactored file recovery logic in cleanup(), moved corruption check after truncation, updated appendTransactionSet() and appendLedgerHeader() to check publish status, and added validation for partial checkpoint file existence |
| src/history/HistoryManagerImpl.cpp | Added check to skip queueing incomplete checkpoints when publishing was previously disabled |
386a68a to
daa39bc
Compare
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
15acb83 to
7f2f4ff
Compare
|
I'm happy to see this getting more edge cases filed off, but I find it a little hard to follow I think mainly because of .. naming? Like it's a bit double-negative heavy: we have a flag tracking if the publication is disabled and then it's set to false once we start filling in a file. I think it might read better if we changed the variable to tracking whether we are currently open-and-appending, and then we return early if we're not at a checkpoint boundary and that's false. WDYT? |
7f2f4ff to
da637c3
Compare
da637c3 to
dcfbcd2
Compare
Small follow up to #5081 to better handle some edge cases