Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
a4c7bf0 to
2d7830b
Compare
|
Rebased onto current master and converting from draft to open. |
ryanofsky
left a comment
There was a problem hiding this comment.
Concept ACK 2d7830b on new test coverage and bundling Flush/flushError together.
For the follow-ups in #35714 (review), note that #36735 is taking item 7 (deleting pruned files after a failed flush), so it might make sense to coordinate there. For items changing how errors are reported (like turning warnings into failures), I could be best to start with item 4, documenting how callers should use the FlushStateToDisk() return value, so later changes can follow a consistent rule instead of being made one at a time.
Would also be good to update description now that PR #35714 is merged, and maybe simplify a little so this can be understood without needing to understand the #35714 history
|
Thanks for the review @ryanofsky . I've updated the PR description so it no longer depends on #35714's history. I'll start with documenting how callers should use the |

FlushStateToDisk()returnsstate.Error(...)whenFlushChainstateBlockFile()fails, relying on the invariant that the flush-error notification has already been emitted (so the node is aborted). Today that invariant holds only because everysuccess = falsebranch inFlushBlockFile/FlushUndoFilehappens to callflushError()itself. A future flush source, or a new error branch, that fails without notifying would makeFlushStateToDisk()report an error withoutAbortNode()being triggered.This PR makes that invariant hold by construction: whenever a flush reports failure, the flush-error notification has been emitted.
BlockManagerunit tests that inject a failure on the block file and on the undo file separately, and assert that each failure emitsflushError.FlushFile()helper performs the flush and emits the notification on failure;FlushBlockFileandFlushUndoFiledelegate to it. No behaviour change.Follow-up to #35714. Possible further work on flush error handling is listed in #35714 (review) (pruned-file deletion after a failed flush is handled in #36735).