Skip to content

Add rocksdb_iter_is_key_pinned and rocksdb_iter_is_value_pinned to C API - #15109

Open
sachinsharma3191 wants to merge 1 commit into
facebook:mainfrom
sachinsharma3191:add-c-api-iter-pinned
Open

Add rocksdb_iter_is_key_pinned and rocksdb_iter_is_value_pinned to C API#15109
sachinsharma3191 wants to merge 1 commit into
facebook:mainfrom
sachinsharma3191:add-c-api-iter-pinned

Conversation

@sachinsharma3191

Copy link
Copy Markdown

Summary

  • Adds two new C API functions to check whether an iterator's key or value is pinned:
    • rocksdb_iter_is_key_pinned(const rocksdb_iterator_t*)
    • rocksdb_iter_is_value_pinned(const rocksdb_iterator_t*)
  • Uses the Iterator::GetProperty mechanism with rocksdb.iterator.is-key-pinned / rocksdb.iterator.is-value-pinned
  • Includes test coverage in db/c_test.c exercising both with and without pin_data

Test plan

  • c_test passes with the new iter_pinned test phase
  • Tests verify pinned status with pin_data=true and exercises the functions without pin_data to ensure no crashes
  • Follows existing C API conventions (returns unsigned char, const iterator parameter)

Closes #14903

Expose Iterator::IsKeyPinned() and IsValuePinned() through the C API so
that C and FFI consumers can check whether an iterator's key or value
buffer is pinned (stable across iterator movements with pin_data).

Closes facebook#14903
@meta-cla

meta-cla Bot commented Aug 14, 2026

Copy link
Copy Markdown

Hi @sachinsharma3191!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla Bot added the CLA Signed label Aug 15, 2026
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.

C API: Add rocksdb_iter_is_key/value_pinned functions

1 participant