couchbase-lite-core icon indicating copy to clipboard operation
couchbase-lite-core copied to clipboard

CBL-5680 + CBL-5681: ReplacementRev enhancement

Open callumbirks opened this issue 1 year ago • 5 comments

callumbirks avatar Apr 30 '24 14:04 callumbirks

Seems like this has broken other tests. I will have to run them locally and fix them

callumbirks avatar May 02 '24 13:05 callumbirks

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

callumbirks avatar May 03 '24 09:05 callumbirks

Fixed the history problem - the Pusher sends history now for the replacement rev. Still getting rejected proposed change.

callumbirks avatar May 03 '24 10:05 callumbirks

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)

callumbirks avatar May 03 '24 11:05 callumbirks

Code Coverage Results:

Type Percentage
branches 69.18
functions 79.82
instantiations 35.54
lines 79.75
regions 76.31

cbl-bot avatar May 08 '24 14:05 cbl-bot