Details
-
Bug
-
Resolution: Fixed
-
Minor
-
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
- blocks
-
CM-318 Add cbl test to cover pull replication for empty database
- Done