Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Uptakes a newer github.com/couchbaselabs/rosmar revision containing the upstream Incr behavior fix (CBG-5411) and adds a parity test to codify the expected Incr contract across Rosmar and Couchbase Server-backed buckets.
Changes:
- Bump
github.com/couchbaselabs/rosmartov0.0.0-20260527130952-42bfa64e0a8e. - Add
TestIncrParityto validateIncrsemantics (missing vs existing keys, amt=0 CAS behavior, wraparound behavior, and largedefbehavior).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go.mod | Updates the Rosmar dependency to the newer pseudo-version containing the Incr fix. |
| go.sum | Updates checksums to match the new Rosmar version. |
| base/bucket_gocb_test.go | Adds a parity test matrix for DataStore.Incr behavior (CAS, overflow/wrap, and default handling). |
| // - On a missing key, the delta is not applied — the stored value is def. | ||
| // - def must fit in int64. CBS's gocb adapter casts def to int64; values | ||
| // > math.MaxInt64 are interpreted as "do not create if absent" and return | ||
| // KEY_ENOENT. Rosmar matches this by returning MissingError. |
Comment on lines
+399
to
+404
| if tc.expectErr { | ||
| require.Error(t, incrErr, "expected Incr to error") | ||
| if tc.existingValue == nil { | ||
| _, _, postErr := dataStore.GetRaw(ctx, key) | ||
| require.Error(t, postErr, "doc should not exist after a failed Incr on missing key") | ||
| } |
gregns1
approved these changes
May 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.
CBG-5411
Uptake couchbaselabs/rosmar#76
Integration Tests
^TestIncrParity$https://jenkins.sgwdev.com/job/SyncGatewayIntegration/696/