Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.0
-
Security Level: Public
-
None
-
CBG Sprint 95, CBG Sprint 96
-
3
Description
When pushing a mutation to a document with an attachment, CBL is setting the attachment revpos to the generation of the current revid, instead of the revision at which the attachment is added. This has been the CBL behaviour since at least CBL 2.5.
This results in Sync Gateway treating the attachment as new to Sync Gateway, and results in a Sync Gateway fetching the attachment from Couchbase Server in order to generate a proveAttachment request.
This will create a lot of unnecessary network traffic between SG and CBS for highly mutated documents with attachments.
In addition, the attachment fetch is always being performed based on the v2 attachment key. As a result, legacy attachments with the CBL updated revpos are always being treated as not found, and triggering GetAttachment handling. This performs an unintended migration of attachments to the v2 storage model.
In cases where the attachment is already present with matching digest on the common ancestor of the incoming revision and the active revision, proveAttachment should not be performed, regardless of revpos. This will address the above issues.
Attachments
Issue Links
- is cloned by
-
CBG-2011 [3.0.1 backport] CBL revpos handling causes attachment fetch per write for docs with attachments
- Closed