Skip to content

Commit 08e6b4a

Browse files
authored
CBL-7565: Replicator stopped with Duplicate ID in version vector erro… (#2369)
* CBL-7565: Replicator stopped with Duplicate ID in version vector error when pushing a doc The cause of this bug is the following. In LiteCore, a Version an HLV may use a special SourceID (kMeSourceID). It stands for the SourceID of whatever database it belongs to. When putting in BLIP message, it is expanded to actual SourceID. The problem is, after rounds of replication, the absolute form of SourceID may come back in the history of a HLV. This caused confustion when the local VV is compared with a VV coming from BLIP messages. We fixed it in VersionVecWithLegacy::parse where we pass the actual SourceID to the Version constructor to turn absolute form to local form.
1 parent cffb68f commit 08e6b4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

LiteCore/RevTrees/VersionVectorWithLegacy.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ namespace litecore {
116116
vector.readASCII(history[0], mySourceID); // -> Single vector (or single version)
117117
} else if ( historyCount == 2 ) {
118118
vector.readASCII(history[1], mySourceID);
119-
vector.add(Version(history[0])); // -> New version plus parent vector
119+
vector.add(Version(history[0], mySourceID)); // -> New version plus parent vector
120120
} else if ( historyCount > 2 ) {
121121
for ( ssize_t i = historyCount - 1; i >= 0; --i )
122-
vector.add(Version(history[i])); // -> List of versions
122+
vector.add(Version(history[i], mySourceID)); // -> List of versions
123123
}
124124
}
125125

0 commit comments

Comments
 (0)