Skip to content

Commit 5279ac8

Browse files
committed
add 0 check for oldest skipped
1 parent b49cac9 commit 5279ac8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

db/change_cache.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func (c *changeCache) DocChanged(event sgbucket.FeedEvent) {
453453
// the two conditions above together means that the cache expect ue to run processEntry on this sequence as its pending
454454
// If seq >= c.getOldestSkippedSequence(ctx) and seq < current sequence allocated to the doc this means
455455
// that this sequence never arrived over the caching feed due to deduplication and was pushed to a skipped sequence list
456-
isSkipped := seq < currentSequence && seq >= oldestSkipped
456+
isSkipped := (seq < currentSequence && seq >= oldestSkipped) && oldestSkipped != 0
457457
if (seq >= nextSequence && seq < currentSequence) || isSkipped {
458458
base.InfofCtx(ctx, base.KeyCache, "Received deduplicated #%d in recent_sequences property for (%q / %q)", seq, base.UD(docID), syncData.CurrentRev)
459459
change := &LogEntry{
@@ -468,6 +468,8 @@ func (c *changeCache) DocChanged(event sgbucket.FeedEvent) {
468468
change.DocID = docID
469469
change.RevID = atRevId
470470
change.Channels = channelRemovals
471+
} else {
472+
// Todo: add unused seq flag here (needs rebase)
471473
}
472474

473475
changedChannels := c.processEntry(ctx, change)

0 commit comments

Comments
 (0)