Skip to content

CXXCBC-649: Implement ExtReplaceBodyWithXattr#752

Merged
avsej merged 3 commits intocouchbase:mainfrom
DemetrisChr:CXXCBC-649-extreplacebodywithxattr
Apr 24, 2025
Merged

CXXCBC-649: Implement ExtReplaceBodyWithXattr#752
avsej merged 3 commits intocouchbase:mainfrom
DemetrisChr:CXXCBC-649-extreplacebodywithxattr

Conversation

@DemetrisChr
Copy link
Copy Markdown
Contributor

@DemetrisChr DemetrisChr commented Apr 15, 2025

Motivation

KV now supports a replace_body_with_xattr subdoc operation. This means we can avoid storing the staged content in the SDK, if the server supports that feature.

Changes

  • Support the revive_document subdoc flag in the core.
  • If the server supports replace_body_with_xattr, we no longer store the staged content when creating a staged_mutation.
  • When committing a staged_mutation and the staged content is not present, that indicates that replace_body_with_xattr is supported. Hence, we use that subdocument operation to commit the staged content.
  • Fixed handling of FAIL_CAS_MISMATCH for commit_doc errors. We should leave ambiguity_resolution_mode unchanged, according to the spec.
  • Updates to do_get:
    • Handle the case where we don't have the content stored in the staged_mutation when the document is in our staged mutations (i.e. the server supports replace_body_with_xattr). In those cases, we now need to fetch it (spec).
    • Implement the optimization where we don't look up the document's ATR if the attempt ID in the document's txn metadata matches our attempt ID. We now immediately return the post-transaction version (spec).

Results

  • All ExtReplaceBodyWithXattr FIT tests pass
  • No regressions in other FIT tests

@avsej avsej force-pushed the CXXCBC-649-extreplacebodywithxattr branch 4 times, most recently from abfbcfb to 8b7e0d6 Compare April 23, 2025 17:51
@avsej avsej force-pushed the CXXCBC-649-extreplacebodywithxattr branch from 8b7e0d6 to b557ca3 Compare April 23, 2025 23:52
@avsej avsej merged commit 41fca4b into couchbase:main Apr 24, 2025
24 of 27 checks passed
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.

2 participants