Repository navigation
fix(core): omit unreported delete counts from errors - #9223
Merged
Merged
Conversation
A deleter may buffer requests before deletion. Leave progress reporting to the underlying deleter and preserve the error context it returns. Refs #9198
PsiACE
approved these changes
Nov 27, 2026
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.
Which issue does this PR close?
Closes #9198.
Rationale for this change
ErrorContextWrapper<T: oio::Delete>attached.with_context("deleted", self.processed.to_string())on bothdelete()andclose()errors (core/core/src/layers/error_context.rs), while never incrementingself.processed. As a result, every delete or close error received a bogusdeleted: 0entry. BecauseError::with_contextappends(key, value)pairs without overwriting existing keys,ErrorContextWrapperalso appended a conflicting seconddeleted: 0when an underlying deleter reported its owndeletedcount.Incrementing
self.processedonoio::Delete::deletesuccess would still be misleading: under theoio::Deletecontract (core/core/src/raw/oio/delete/api.rs), a successfuldelete()return only means the deleter accepted the request—deleters may buffer requests for batch deletion, so accepted requests are not durable deletion progress. Omitting the wrapper-injecteddeletedfield leaves progress reporting to the underlying deleter while preservingOperation::Delete,service,path(ondelete()), and all lower-level diagnostics.What changes are included in this PR?
core/core/src/layers/error_context.rs: Remove.with_context("deleted", self.processed.to_string())fromErrorContextWrapper<T: oio::Delete>::deleteandclose, and remove the correspondingdeletedbullet fromErrorContextLayerrustdoc.core/core/src/layers/error_context.rs):test_delete_error_omits_unreported_count: verifiesdelete()errors omitdeletedwhile preserving error kind, message,Operation::Delete,service,path, and inner context (request_id).test_delete_close_error_preserves_reported_count: verifiesclose()errors preserve error kind, temporary status, message, source,Operation::Delete,service, innerpath,called: batch_delete, and a single innerdeleted: 1without appendingdeleted: 0.Verification scope
75966ba464). Both regression tests failed when applied to the baseline.delete()appendeddeleted: 0, andclose()appended a duplicatedeleted: 0alongside innerdeleted: 1.86b538bc94): All 531opendal-coreunit tests,opendal-coreclippy (--all-targets --all-features -- -D warnings), andcore/formatting (cargo fmt --all -- --check) passed.86b538bc94and applied itserror_context.rsto a separate local checkout at31b4558934. Both regressions and the 372-testopendal-coresuite passed in that checkout.ErrorContextWrapperin process. The reporteddeleted: 1comes from the test deleter.Are there any user-facing changes?
ErrorContextLayerno longer appends the always-zerodeletedcontext entry ondelete()andclose()errors and removesdeletedfromErrorContextLayerrustdoc.Operation::Delete,service,path(ondelete()), and lower-level error diagnostics (including anydeletedcount reported by an underlying deleter) are preserved.This is a compatible diagnostic fix in
opendal-corefor thecorerelease package.Breaking changes
AI Usage Statement
pi(via T3), Model:magpie/codex/gpt-6.2-astra, Effort:high, Role: Triaged fix(core): ErrorContextWrapper<oio::Delete> never increments deleted count #9198 againstoio::DeleteandErrorContextLayer, coordinated independent review, and verified commit86b538bc94along with the before/after test logs.pi(via T3), Model:magpie/codex/gpt-6.2-sol, Effort:max, Role: Authored86b538bc94(core/core/src/layers/error_context.rs), added thedelete()andclose()regression unit tests, and ran before/afteropendal-coreunit tests, clippy, and formatting checks on the candidate. Verified integration with currentmainand published the signed commit.pi(via T3), Model:magpie/devin/swe-2-1, Effort:max, Role: Independently reviewed86b538bc94and its regression test scope, and exercised the candidateerror_context.rson a separate local checkout (not an exact-head test run).pi(via T3), Model:magpie/agy-cli/gemini-4-neon, Effort:high, Role: Drafted the PR title and body from86b538bc94and the local verification logs.