Detect and handle _sync:seq rollback in sequence allocator

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.

Activity

Show:

CB robot August 13, 2024 at 4:51 PM

Build sync_gateway-4.0.0-34 contains sync_gateway commit 05718ec with commit message:
: handle rollback of the _sync:seq document in the bucket (#6837)

CB robot July 24, 2024 at 9:03 PM

Build sync_gateway-3.3.0-11 contains sync_gateway commit 05718ec with commit message:
: handle rollback of the _sync:seq document in the bucket (#6837)

CB robot June 18, 2024 at 4:30 PM

Build sync_gateway-3.2.0-435 contains sync_gateway commit 05718ec with commit message:
: handle rollback of the _sync:seq document in the bucket (#6837)

CB robot June 18, 2024 at 7:10 AM

Build sync_gateway-3.2.0-433 contains sync_gateway commit 2cbcb6b with commit message:
: handle rollback of the _sync:seq document in the bucket (#6837)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Story Points

Components

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created March 15, 2024 at 4:15 PM
Updated February 25, 2025 at 7:02 PM
Resolved August 15, 2024 at 1:34 PM
Instabug