Repository navigation
StatementOperation is a NoDataReturnedCall: no false ConcurrencyException after UndoDeleteWhere / HardDeleteWhere (#5743) - #5749
Merged
Conversation
UndoDeleteWhere and HardDeleteWhere (and the projection UnDelete paths) queue a bare StatementOperation, which was not marked NoDataReturnedCall, unlike Deletion and PatchOperation. The batch therefore called NextResult after its UPDATE / DELETE, which produces no result set, and skipped the next operation's result. A numeric-revision upsert queued after it read nothing back and threw a ConcurrencyException for a write that had not conflicted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This was referenced Oct 24, 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.
Closes #5743, found today while implementing #5740's undelete.
Root cause
When
ApplyCallbacksAsyncpost-processes a batch, it callsNextResultafter every operation that is not aNoDataReturnedCall.UndoDeleteWhereandHardDeleteWherequeue a bareStatementOperation. So does the projectionUnDeletepath.StatementOperationwas not markedNoDataReturnedCall, although its subclassesDeletion(throughIDeletion) andPatchOperationalways were.NextResultskipped the next operation's result instead.ConcurrencyExceptionfor a write that had not conflicted. It did so even when the statement matched nothing.DeleteWherewas never affected because it builds aDeletion. That is why the issue's table shows it working.Fix
StatementOperation : Statement, IStorageOperation, NoDataReturnedCall, with a remark saying why the marker is load-bearing.The projection
UnDeletepaths had the same misalignment. It was harmless there only because the upsert after them ignores revision conflicts (IgnoreConcurrencyViolation, orRevision == 0).Tests
DocumentDbTests.Deleting.Bug_5743_statement_before_revisioned_upsert:UndoDeleteWhere, thenUpdateRevision(note, 2): red on master (ConcurrencyException), green here.HardDeleteWhere, thenUpdateRevision(note, 2): red on master, green here.UpdateRevision(note, 1)after the statement is still refused, so the fix does not switch the guard off.Regression runs (net10.0, PG 17):
DocumentDbTests.Deletingnamespace: 83 passed, 1 skipped;ShouldDeleteand archiving projection classes: 49 passed, 1 skipped.#5744's
UndeleteDocumentAsyncqueues the upsert beforeUndoDeleteWhereto step around this bug, and its comment says so. That ordering stays correct after this fix.🤖 Generated with Claude Code