[3.1.6 backport] updateSeq must happen after DCP callback invocation

Description

We're currently updating the last processed sequence before invoking the DCP callback.  In the majority of cases this is harmless, as the metadata won't be persisted unless incrementCheckpoint is called (which happens after the callback).

Similarly, in the case of node failure, the updated sequence will only be in memory and not persisted, so shouldn't cause a problem.

However, there appears to be a corner case associated with pindex rebalance.  When a feed is gracefully closed it will trigger persistence of the metadata when the stream is reopened, which has the potential to pick up an updated sequence associated with the previous pindex (which may include an in-flight sequence update).  If that in-flight update subsequently fails, the DCP checkpoint will have been moved past the mutation.

Activity

Show:

CB robot May 1, 2024 at 4:20 PM

Build sync_gateway-3.1.6-3 contains sync_gateway commit 5193389 with commit message:
[3.1.6 Backport] https://couchbasecloud.atlassian.net/browse/CBG-3845#icft=CBG-3845: Ensure sequence update waits for callback invocation (#6797)

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

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created March 20, 2024 at 4:46 AM
Updated February 25, 2025 at 7:02 PM
Resolved May 1, 2024 at 2:37 PM
Instabug