Repository navigation
Sync Gateway 4.x: version vectors (CV) instead of revtree _rev - #14
Merged
Merged
Conversation
- PUT sends the current _cv in the body; DELETE sends ?rev=<URL-encoded CV> - Strip _rev/_cv/_revisions from input docs before writing - CHANGES uses version_type=cv; GET_RAW logs the _vv xattr - New CONFLICT / CONFLICT_ADMIN op: stale CV write, expects 409 - Failed requests log HTTP status + SG reason instead of null - Fall back to admin read for CV when a user can write but not read - Fix: input doc mutated across users; CHANGES/PURGE ignored scope/collection; swapped default sgAdminPassword/logPathToWriteTo - PURGE and GET_RAW run once per doc as admin - Refactor operation loop into per-operation methods - Tests use a temp dir (no longer delete jsons/), cover 4.x behaviour - docker/ stack: Couchbase Server 8.0.3 + Sync Gateway 4.1.2 - README: SG 4.x section, Docker instructions; CI triggers on sg-4.x Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fujio-Turner
added a commit
that referenced
this pull request
Nov 17, 2026
main now matches master (including the SG 4.x version-vector work from #14). Everything only on main was already superseded on master: superLinter.yml (replaced by main.yml), the old test/ dir (now tests/), jsons/job:12345.json (renamed to job-12345.json), and an older example sync function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
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.
Summary
Moves the tester to Sync Gateway 4.x version vectors. Documents are now versioned by their Current Version (
_cv, e.g.18e8e11501350000@+RTUz3ZWvU8ktL6AuG0csA), not by the revision-tree_rev. The 3.x code is kept on thesg-3.x-restbranch.Version vector changes
PUTsends the document's current_cvin the body.DELETEsends?rev=<URL-encoded CV>. CVs contain@,+and/, and an unencoded+gets a 400._rev,_cvor_revisionsin input JSON files is stripped. The tester always sends the live CV.CHANGESaddsversion_type=cv, so rows show{"cv": ...}.GET_RAWlogs the_vvxattr (src,ver,cvCas).CONFLICT/CONFLICT_ADMINoperation: writes with a stale CV and logs[success]when SG returns 409.Other improvements
forbiddenmessage) where they used to lognull. The[success]/[failed]log format is unchanged.CHANGESandPURGEignored scope and collection; the defaultsgAdminPasswordandlogPathToWriteTovalues were swapped.PURGEandGET_RAWrun once per doc as admin.jsons/) and cover the 4.x behaviour. There are 20 tests and flake8 passes.docker/adds a local stack: Couchbase Server 8.0.3, SG 4.1.2, a sample sync function and userbob.Test plan
pytest: 20 passedflake8cleandocker/setup.sh) with the defaultconfig.json, and with test docs that hit 403 (missing role, admin required, sync function throw), 404 and 409🤖 Generated with Claude Code