Skip to content

Conversation

@vardaro
Copy link

@vardaro vardaro commented Dec 26, 2025

I am trying to use rocksdb::OptimisticTransactionDB over FFI and noticed the option I need, occ_lock_buckets, isn't settable. I noticed this related issue #11703 was marked up for grabs and I went ahead and introduced OptimisticTransactionDBOptions to the C API.

Unfortunately, this contains a breaking change in the C API, in that I decided to include rocksdb_optimistictransactiondb_options_t * in the signature of rocksdb_optimistictransactiondb_open() and rocksdb_optimistictransactiondb_open_column_families().

We could preserve backwards compatibility by adding logical overloads that include the options pointer, but I am a bit partial to keeping the APIs consistent with transactiondb if possible. Happy to go the other way if the community feels otherwise. For the open functions, setting rocksdb_optimistictransactiondb_options_t * to null causes the defaults of OptimisticTransactionDB to get applied. Passing an options pointer without any of the fields mutated will assume the defaults in OptimisticTransactionDB.

I added a new overload for OptimisticTransactionDB::Open() that imitates the "simple" overload signature. It omits the CF-handle related arguments, but allows the caller to pass OptimisticTransactionDBOptions. The original "simple" overload now calls this new overload, assuming the default constructed OptimisticTransactionDBOptions. This allowed me to reduce CF-handle related logic in the C interface, and centralize more in the core RocksDB layer. This Open() refactor could stand to be its own PR, since it's useful when using the C++ interface.

@meta-cla meta-cla bot added the CLA Signed label Dec 26, 2025
@vardaro
Copy link
Author

vardaro commented Dec 31, 2025

@pdillinger Hey Peter (or whoever might be the best person to provide feedback), can you give this a review? Thanks

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.

1 participant