Skip to content

Commit fa4e166

Browse files
committed
[BP] MB-58961: Remove seqno checks for backfill from AS:registerCursor
Checks originally introduced in MB-22960. In the current code base those checks are already enforced in CM::registerCursorBySeqno(), which is were we determine whether a backfill is needed or not. That area is in general well covered by unit tests. Specifically for MB-22960 we have the following original tests that guard this change: - MB22960_cursor_dropping_data_loss - MB25056_do_not_set_pendingBackfill_to_true - MB25056_backfill_not_required Change-Id: I573059d2d05701e2024b890b1d84d708768e9833 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/198871 Reviewed-by: Trond Norbye <[email protected]> Well-Formed: Restriction Checker Tested-by: Paolo Cocchi <[email protected]>
1 parent 84b1d83 commit fa4e166

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

engines/ep/src/dcp/active_stream.cc

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -256,25 +256,7 @@ void ActiveStream::registerCursor(CheckpointManager& chkptmgr,
256256
CursorRegResult result = chkptmgr.registerCursorBySeqno(
257257
name_, lastProcessedSeqno, CheckpointCursor::Droppable::Yes);
258258

259-
/*
260-
* MB-22960: Due to cursor dropping we re-register the replication
261-
* cursor only during backfill when we mark the disk snapshot. However
262-
* by this point it is possible that the CheckpointManager no longer
263-
* contains the next sequence number the replication stream requires
264-
* (i.e. next one after the backfill seqnos).
265-
*
266-
* To avoid this data loss when we register the cursor we check to see
267-
* if the result is greater than the lastProcessedSeqno + 1.
268-
* If so we know we may have missed some items and may need to perform
269-
* another backfill.
270-
*
271-
* We actually only need to do another backfill if the result is greater
272-
* than the lastProcessedSeqno + 1 and registerCursorBySeqno returns
273-
* true, indicating that the resulting seqno starts with the first item
274-
* on a checkpoint.
275-
*/
276-
const uint64_t nextRequiredSeqno = lastProcessedSeqno + 1;
277-
if (result.seqno > nextRequiredSeqno && result.tryBackfill) {
259+
if (result.tryBackfill) {
278260
pendingBackfill = true;
279261
}
280262
curChkSeqno = result.seqno;

0 commit comments

Comments
 (0)