Skip to content

Allow FullMergeV3 to produce a deletion result via std::monostate#14607

Open
zaidoon1 wants to merge 1 commit intofacebook:mainfrom
zaidoon1:merge-operator-deletion-result
Open

Allow FullMergeV3 to produce a deletion result via std::monostate#14607
zaidoon1 wants to merge 1 commit intofacebook:mainfrom
zaidoon1:merge-operator-deletion-result

Conversation

@zaidoon1
Copy link
Copy Markdown
Contributor

Add std::monostate as a fourth alternative to
MergeOperationOutputV3::NewValue. When a merge operator sets this variant, the key is treated as deleted:

  • Get()/MultiGet() return Status::NotFound()
  • Iterators skip the key (forward and backward)
  • Compaction produces a deletion tombstone, or drops the key entirely when the full history has been seen at the bottommost level

This enables use cases like counter auto-delete-at-zero, conditional mutations, and Cassandra-style row expiration without requiring a separate compaction filter.

Closes #14593

@meta-cla meta-cla bot added the CLA Signed label Apr 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 12, 2026

✅ clang-tidy: No findings on changed lines

Completed in 364.3s.

@zaidoon1 zaidoon1 force-pushed the merge-operator-deletion-result branch 4 times, most recently from d3c531c to 30c844c Compare April 12, 2026 07:53
Add std::monostate as a fourth alternative to
MergeOperationOutputV3::NewValue. When a merge operator sets this
variant, the key is treated as deleted:

- Get()/MultiGet() return Status::NotFound()
- Iterators skip the key (forward and backward)
- Compaction produces a deletion tombstone, or drops the key entirely
  when the full history has been seen at the bottommost level

This enables use cases like counter auto-delete-at-zero, conditional
mutations, and Cassandra-style row expiration without requiring a
separate compaction filter.

Closes facebook#14593
@zaidoon1 zaidoon1 force-pushed the merge-operator-deletion-result branch from 30c844c to f66c937 Compare April 12, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MergeOperator: allow FullMergeV3 to produce a deletion result

1 participant