Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-583

Skip-deleted-docs optimization never enabled in pull replication

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.7.0
    • 2.0.0
    • None
    • Security Level: Public
    • None
    • CBG Sprint 34
    • 1

    Description

      On the first pull into an empty database, LiteCore should tell SG not to send any deleted documents (tombstones), by setting the "activeOnly" property in the "subChanges" request. Unfortunately this is not hooked up.

      The result is reduced replication performance on the first pull, and a larger-than-necessary local database, if there are a lot of tombstones on the server. No functional problems.

      Here's what I found:

      • The Puller sets "activeOnly" if its member _skipDeleted is true. (Puller.cc:71)
      • _skipDeleted is set if the replicator option kC4ReplicatorOptionSkipDeleted is set, or if the _setSkipDeleted() method is called.
      • There is no code that sets the kC4ReplicatorOptionSkipDeleted option (in LiteCore or CBL-iOS; I would assume not on Android or .NET either since we have no public API to set this.)
      • There are no calls to _setSkipDeleted() in LiteCore.

      It looks as though the Replicator class was supposed to call _setSkipDeleted() if the database is empty and there is no checkpoint, but that logic was either deleted by accident or never written.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              adamf Adam Fraser
              jens Jens Alfke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty