feat: classify database atomic failures - #49
Merged
Conversation
Distinguish failures that occur before the current DB batch can mutate state from failures after apply begins. Preserve the existing DB::atomic signature and retain the underlying Holt error for callers. Signed-off-by: Guocheng(Eric) Song <132118805+feichai0017@users.noreply.github.com>
Update the database fuzz oracle for the classified errors returned by DB atomic operations. Expected model errors now require a definitely-not-applied wrapper and the matching source error. Signed-off-by: Guocheng(Eric) Song <132118805+feichai0017@users.noreply.github.com>
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.
What changed
DB::atomicnow wraps failures inError::Atomic. The newAtomicErrorKinddistinguishes a batch that definitely did not apply from abatch whose outcome is unknown. The existing method signature stays the same,
and
Tree::atomickeeps its current behavior.Why
Callers such as NoKV need to retry storage failures that happen before the
current batch mutates state. They must fail closed after walker mutation, WAL
submission, or acknowledgement begins. The previous
holt::Errorvalue didnot expose that boundary.
The classification applies only to the current batch. Holt can still flush
writes acknowledged by earlier calls before it starts the batch.
Validation
cargo test --workspace --all-targetscargo test --workspace --libcargo clippy --workspace --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-depscargo fmt --all -- --checkand post-apply failures
Follow-up
NoKV will consume this API after a Holt release includes the change. This PR
does not change the package version or publish a release.