Repository navigation
Treat a path mismatch in DeleteWithXattrs like a missing xattr - #103
Merged
Merged
Conversation
Like Couchbase Server, a path through a scalar xattr value fails the combined delete in the same way as a missing xattr. On a live document, only the body is deleted. On a tombstone, the error is ErrPathMismatch, or not found when every path fails. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the described semantics and is adequately covered by focused tests.
0 open findings
What changed in this PR
Aligns DeleteWithXattrs path-mismatch behavior with Couchbase Server.
Changes:
- Preflights xattr paths and distinguishes missing paths from path mismatches.
- Expands tests for live documents and tombstones.
| File | Description |
|---|---|
collection+xattrs.go |
Implements failed-path detection and error handling. |
collection_test.go |
Verifies missing and mismatched xattr behavior. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
torcolvin
marked this pull request as ready for review
October 9, 2026 01:42
torcolvin
added a commit
to couchbase/sync_gateway
that referenced
this pull request
Oct 9, 2026
…d events Update rosmar to couchbaselabs/rosmar#103, which treats a path through a scalar xattr in DeleteWithXattrs like a missing xattr, as Couchbase Server does. Add the matching DeleteWithXattrsPathMismatch subtest. TestXattrOnlyWriteKeepsTombstone now checks that the DCP feed reports each xattr-only write to a tombstone as a deletion. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
5 tasks done
bbrks
approved these changes
Oct 9, 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.
DeleteWithXattrsnow handles a path through a scalar xattr value in the same way as a missing xattr, which matches Couchbase Server.Document
The path
_sync.revgoes through_sync, which is a string and not a JSON object.Code
Results
_sync.revErrPathMismatch. Body and xattrs unchanged._sync.rev,_xattr1ErrPathMismatch. Body and xattrs unchanged._sync.revErrPathMismatch. Xattrs unchanged.MissingError. Xattrs unchanged._sync.rev,_xattr1ErrPathMismatch. Xattrs unchanged.ErrPathMismatch. Xattrs unchanged.A failed path makes the xattr part of the delete fail. On a live document, the body delete still happens. If every path fails on a tombstone, the error is
MissingError. Otherwise, it is the error for the first failed path.TestDeleteWithXattrsPathMismatchcovers each row. If a tombstone has only some of the xattrs,TestDeleteWithXattrsMissingXattrnow expectsErrPathNotFound.🤖 Generated with Claude Code