Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move _attachments metadata to _sync #3667

adamcfraser opened this issue Jun 29, 2018 · 0 comments


Copy link

commented Jun 29, 2018

Currently SG stores attachment metadata in the document body, in a reserved top-level _attachments property. The value of the _attachments property is rewritten at read-time, based on request parameters (attachmentsSince).

Moving _attachments from the document body to _sync is a prerequisite for the following enhancements:

  • Avoiding unmarshalling document bodies during read (#2382)
  • Support CBL 2.0 blobs (#3377)

The REST API must continue to support read/write of documents with the _attachments property in the document body. This would be similar to existing processing today to add the _id and _rev properties.

Additional considerations:

  • For REST API writes, calculation of the revision id should before removing the _attachments property from the document body (for backwards compatibility w/ 1.x clients).
  • The revision cache should be enhanced to store the attachments metadata outside the body (similar to what's already done for history and channel data)
  • This enhancement should allow us to avoid the work being done in MutableAttachmentsCopy
  • Ensure that no inline attachments are being persisted to the bucket in _attachments, to avoid hitting size limits when storing _sync as xattr

@adamcfraser adamcfraser added this to the 2.5.0 milestone Jun 29, 2018

@bbrks bbrks added the ready label Jul 9, 2018

@adamcfraser adamcfraser added the P1: high label Jul 9, 2018

@bbrks bbrks referenced this issue Jul 19, 2018
0 of 2 tasks complete
@bbrks bbrks referenced this issue Aug 1, 2018
5 of 5 tasks complete

@pasin pasin added in progress and removed ready labels Aug 1, 2018

@bbrks bbrks added the review label Aug 1, 2018

@bbrks bbrks closed this in #3687 Aug 2, 2018

bbrks added a commit that referenced this issue Aug 2, 2018

#3667 Store attachment metadata in sync data (#3687)
* Store attachment metadata in sync data

* Remove unnecessary  MutableAttachmentsCopy

* Add TODO for rev cache attachment metadata storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.