CBL sending rev list with gaps, when sync'ing more than 20 revs

Description

Follow up from

https://couchbasecloud.atlassian.net/browse/CBG-1669

 

It's quite easy to get CBL to build a rev tree for a document which results in SG emitting warnings in the logs for "Found gap in revision list. Expecting gen 6 but got 5 in [...]". This warning actually doesn't only happen on the push, and is continually logged for every missing revision generation every time the affected document is marshalled until SG is able to prune the affected gap away.

This happens on the client side when a document the server knows about is mutated enough times for the revision tree history to be truncated between the last known server rev and the most recent N revs on the client. Currently this setting determines a maxHistory of 20 revisions, but I believe it should be client-side configurable.

 

Related user reported issue (for the old warning message):

Setup

  • CBL / SG Version: Android EE 2.8.6 / 3.0.0-392

  • SG Config: Default database config

Repro steps

  1. Start CBL and SG with a continuous bidirectional replication

  2. Create a doc (at rev 1) on the client and have it pushed to SG

  3. Stop the CBL replicator

  4. Mutate the document on the client enough to have a gap larger than 20 (rev 22)

  5. Start the CBL replicator again and let rev 22 be synced

Actual Result:

  • Observe "Found gap" warning in SG logs

Expected Result:

  • Don't see a warning for this expected behaviour

Logs :

Step 2

Step 5

Attachments

1

Activity

Show:

CB robot February 4, 2023 at 5:40 AM

Build couchbase-lite-log-3.1.0-195 contains couchbase-lite-core commit ff59c23 with commit message:
: Prevent rev list gaps (#1668)

CB robot February 4, 2023 at 2:22 AM

Build couchbase-lite-cblite-3.1.0-186 contains couchbase-lite-core commit ff59c23 with commit message:
: Prevent rev list gaps (#1668)

CB robot January 27, 2023 at 10:29 PM

Build couchbase-lite-ios-3.1.0-298 contains couchbase-lite-core commit ff59c23 with commit message:
: Prevent rev list gaps (#1668)

CB robot January 27, 2023 at 4:36 PM

Build couchbase-lite-c-3.1.0-220 contains couchbase-lite-core commit ff59c23 with commit message:
: Prevent rev list gaps (#1668)

CB robot January 27, 2023 at 4:32 PM

Build couchbase-lite-net-3.1.0-156 contains couchbase-lite-core commit ff59c23 with commit message:
: Prevent rev list gaps (#1668)

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

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created December 22, 2021 at 4:00 PM
Updated August 31, 2024 at 10:57 AM
Resolved January 16, 2023 at 1:27 PM
Instabug