couchbase-lite-core
couchbase-lite-core copied to clipboard
CBL-5680 + CBL-5681: ReplacementRev enhancement
Seems like this has broken other tests. I will have to run them locally and fix them
The test "Continuous Super-Fast Push" is failing consistently. The issue seems to be this; One side receives a replacementRev, which apparently has no history:
Obj=/Repl#21/puller#27/incomingrev#29/ {Coll#0} Received revision 'dock' #27-ffff (seq '17') (replaced rev #17-ffff)
Obj=/Repl#21/puller#27/incomingrev#29/ Server sent no history with 'dock' #27-ffff
Then later, when its receiving the next rev, it has the wrong parent:
Obj=/Repl#21/revfinder#26/ {Coll#0} Rejecting proposed change 'dock' #40-ffff with parent 17-ffff (status 409; current rev is 27-ffff)
I guess this is because the other side thinks this side only has rev#17, but it has rev#27
Fixed the history problem - the Pusher sends history now for the replacement rev. Still getting rejected proposed change.
I fixed the rejected rev issues by making sure the remote ancestor on the pusher is set to the new rev, rather than the one which has been replaced. Although now I see another issue, when the checkpoints are validated in the test:
/Users/callumbirks/cblite/litecore/couchbase-lite-core/LiteCore/tests/../../Replicator/tests/ReplicatorLoopbackTest.hh:652: Failure:
CHECK(doc->body == c4str(body))
with expansion:
slice["{"local":23,"localCompleted":[0,24,33,8,52,8,70,9,89,9,108,9,128,8,147,8,166,8,184,9,201,1]}"]
==
slice["{"local":201}"]
with message:
Checking local checkpoint 'cp-i1W0vKdCzXmflOx92CDuWLF3ybleltHuCPbcR9sCCaM=
/Users/callumbirks/cblite/litecore/couchbase-lite-core/LiteCore/tests/../../Replicator/tests/ReplicatorLoopbackTest.hh:652: Failure:
CHECK(doc->body == c4str(body))
with expansion:
slice["{"local":23,"localCompleted":[0,24,33,8,52,8,70,9,89,9,108,9,128,8,147,8,166,8,184,9,201,1]}"]
==
slice["{"local":201}"]
with message:
Checking remote checkpoint 'cp-i1W0vKdCzXmflOx92CDuWLF3ybleltHuCPbcR9sCCaM=
ie the {"local":201} was expected, but the checkpoint doc was actually the above one with the large array of "localCompleted".
EDIT: Interestingly, the rev sequence which is in local (23) is one before the first rev which was replicated (24 in this run)
Code Coverage Results:
| Type | Percentage |
|---|---|
| branches | 69.18 |
| functions | 79.82 |
| instantiations | 35.54 |
| lines | 79.75 |
| regions | 76.31 |