Skip to content

Commit 2736cc1

Browse files
pimpinclaude
andcommitted
Fix _sync xattr field name: use _deleted instead of deleted
The Sync Gateway _sync xattr uses `_deleted` (with underscore) not `deleted` as the field name to indicate tombstone status. Changes: - Query `_sync._deleted` instead of `_sync.deleted` - Add WARNING comment that querying _sync directly is unsupported in production - Reference Sync Gateway documentation on shared bucket access This fix enables proper detection of tombstones vs live documents in CBS when using shared bucket access mode. According to Sync Gateway docs, the _sync structure is internal and can change between versions. Direct N1QL queries on _sync should only be used for testing/debugging, not in production applications. References: - https://docs.couchbase.com/sync-gateway/current/shared-bucket-access.html - Sync Gateway GitHub issues discussing _sync structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f6db007 commit 2736cc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/utils/cbs_admin.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ pub fn check_doc_in_cbs(doc_id: &str) {
4444
// Use port 8093 for Query service (not 8091 which is admin/REST API)
4545
// Query XATTRs to see tombstones in shared bucket access mode
4646
// The _sync xattr contains Sync Gateway metadata including deleted status
47+
//
48+
// WARNING: Querying _sync xattr directly is UNSUPPORTED in production per Sync Gateway docs
49+
// This is only for testing/debugging purposes. The _sync structure can change between versions.
50+
// Reference: https://docs.couchbase.com/sync-gateway/current/shared-bucket-access.html
4751
let url = "http://localhost:8093/query/service";
4852
let query = format!(
49-
"SELECT META().id, META().xattrs._sync.deleted as deleted FROM `{CBS_BUCKET}` USE KEYS ['{doc_id}']"
53+
"SELECT META().id, META().xattrs._sync._deleted as deleted FROM `{CBS_BUCKET}` USE KEYS ['{doc_id}']"
5054
);
5155
let body = serde_json::json!({"statement": query});
5256

0 commit comments

Comments
 (0)