Skip to content

feat: classify database atomic failures - #49

Merged
feichai0017 merged 2 commits into
mainfrom
agent/atomic-outcome-classification
Aug 11, 2026
Merged

feat: classify database atomic failures#49
feichai0017 merged 2 commits into
mainfrom
agent/atomic-outcome-classification

Conversation

@feichai0017

Copy link
Copy Markdown
Member

What changed

DB::atomic now wraps failures in Error::Atomic. The new
AtomicErrorKind distinguishes a batch that definitely did not apply from a
batch whose outcome is unknown. The existing method signature stays the same,
and Tree::atomic keeps 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::Error value did
not 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-targets
  • cargo test --workspace --lib
  • cargo clippy --workspace --all-targets -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
  • cargo fmt --all -- --check
  • fault tests cover catalog, guard, old write-delta flush, WAL-size preflight,
    and 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.

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>
@feichai0017
feichai0017 marked this pull request as ready for review August 11, 2026 06:11
Copilot AI lite review requested due to automatic review settings August 11, 2026 06:11
@feichai0017
feichai0017 merged commit f2a9ac1 into main Aug 11, 2026
25 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants