Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.1.0
-
Untriaged
-
1
-
Yes
Description
Reproduction
- Create two collections, c1 and c2
- Create a mutation to key 'A' in c1 and c2
- Do a backup
- Create a mutation 'B' in c1 and c2
- Delete c2
- Do a backup
- Do a restore/merge
What should happen
The merge or restore should complete and contain just 'A' and 'B' in c1
What actually happens
The merge/restore correctly transfers data from the first backup but during the second backup fails with a message such as:
Error merging data: snapshot marker for vBucket 55 isn't valid {Timestamp:0 Start:0 End:5} -> {Timestamp:0 Start:4 End:6} |
During a merge/restore we only transfer the data that will exist at the end, so if you delete a collection the mutations from it won't be transferred. We therefore advance the seqno to take account of any mutations in a deleted collection that happen after the last transferred mutation. Up to here the behaviour is correct. At the end of a transfer however we will flush the writer and then persist the last committed seqno - but this can be lower than the seqno we've advanced forward.
In the example above we have the following mutations:
backup 1:
|
4 - c1 A
|
5 - c2 A
|
backup 2:
|
6 - delete c1
|
so here we will advance to seqno 5 to take account of the creation of A in c2, but the last committed seqno will be 4 as it is the last mutation in an alive collection - ie one that we transfer.