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

CBG-4206: read/write attachments to global sync xattr #7107

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

gregns1
Copy link
Contributor

@gregns1 gregns1 commented Sep 4, 2024

CBG-4206

  • Read attachments form new _globalSync xattr
  • If not defined there but in sync data instead, code will read from there instead
  • All new writes will have attachments moved to _globalSync
  • Kept in memory storage of attachment metadata in sync data so essentially global xattr is only used at read/write time
  • Wanted to remove the attachments json property from sync data struct (like what was done with HLV in sync data) but this broke migration from inline sync data to xattr so had to keep it in.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

Copy link
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a question about the new test

hi := globalXattr.GlobalAttachments["hi.txt"].(map[string]interface{})

assert.Len(t, globalXattr.GlobalAttachments, 1)
assert.Equal(t, float64(2), hi["length"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth extending this test to include a document update as well, to ensure we move the persisted xattrs over as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good shout! Extended this test but also added new test for update to doc with attachment meta in sync data.

@gregns1 gregns1 merged commit 05abda1 into release/anemone Sep 12, 2024
36 checks passed
@gregns1 gregns1 deleted the CBG-4206 branch September 12, 2024 13:30
adamcfraser pushed a commit that referenced this pull request Nov 29, 2024
* CBG-4206: read/write attchments to global sync xattr

* add commnet to doc struct for global sync

* chnages after rebase

* updates to add new test + test case

* fix misspelling
bbrks pushed a commit that referenced this pull request Dec 2, 2024
* CBG-4206: read/write attchments to global sync xattr

* add commnet to doc struct for global sync

* chnages after rebase

* updates to add new test + test case

* fix misspelling
bbrks pushed a commit that referenced this pull request Dec 5, 2024
* CBG-4206: read/write attchments to global sync xattr

* add commnet to doc struct for global sync

* chnages after rebase

* updates to add new test + test case

* fix misspelling
bbrks pushed a commit that referenced this pull request Dec 17, 2024
* CBG-4206: read/write attchments to global sync xattr

* add commnet to doc struct for global sync

* chnages after rebase

* updates to add new test + test case

* fix misspelling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants