Skip to content

Commit 6c3070b

Browse files
bbrkstorcolvin
andauthored
CBG-4832: Handle legacy rev IDs as deltaSrc even when running in HLV mode (#7698)
Co-authored-by: Tor Colvin <tor.colvin@couchbase.com>
1 parent c089b1b commit 6c3070b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

db/blip_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,10 +1141,10 @@ func (bh *blipHandler) processRev(rq *blip.Message, stats *processRevStats) (err
11411141
// due to no-conflict write restriction, but we still need to enforce security here to prevent leaking data about previous
11421142
// revisions to malicious actors (in the scenario where that user has write but not read access).
11431143
var deltaSrcRev DocumentRevision
1144-
if bh.useHLV() {
1144+
if bh.useHLV() && !base.IsRevTreeID(deltaSrcRevID) {
11451145
deltaSrcVersion, parseErr := ParseVersion(deltaSrcRevID)
11461146
if parseErr != nil {
1147-
return base.HTTPErrorf(http.StatusUnprocessableEntity, "Unable to parse version for delta source for doc %s, error: %v", base.UD(docID), err)
1147+
return base.HTTPErrorf(http.StatusUnprocessableEntity, "Unable to parse version for delta source for doc %s, error: %v", base.UD(docID), parseErr)
11481148
}
11491149
deltaSrcRev, err = bh.collection.GetCV(bh.loggingCtx, docID, &deltaSrcVersion, false)
11501150
} else {

rest/blip_api_delta_sync_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,6 @@ func TestBlipDeltaSyncPullRevCache(t *testing.T) {
933933
// TestBlipDeltaSyncPush tests that a simple push replication handles deltas in EE,
934934
// and checks that full body replication is still supported in CE.
935935
func TestBlipDeltaSyncPush(t *testing.T) {
936-
937-
t.Skip("TODO: CBG-4832 - Failing because of broken legacy rev ID as deltaSrc logic in processRev")
938936
base.SetUpTestLogging(t, base.LevelDebug, base.KeyCRUD, base.KeySGTest, base.KeySyncMsg, base.KeySync)
939937
sgUseDeltas := base.IsEnterpriseEdition()
940938
rtConfig := RestTesterConfig{

0 commit comments

Comments
 (0)