Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Security Level: Public
-
None
Description
The sequence allocator assumes that the next allocated sequence is always going to be larger than the previously seen sequence. There are a few scenarios where _sync:seq could be rolled back on the server:
- vbucket failover/rollback
- incorrect migration of data into the bucket (XDCR, backup/restore)
If _sync:seq is rolled back while Sync Gateway is running, the sequence allocator has the ability to detect this and restore _sync:seq to a value greater than the last allocated sequence on the node.
The solution needs to consider the case where multiple nodes detect this rollback concurrently.