facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.66k stars 6.33k forks source link

Expose OptimisticTransactionDBOptions in C API #11703

Open Chaoses-Ib opened 1 year ago

Chaoses-Ib commented 1 year ago

Expected behavior

OptimisticTransactionDB will allocate 1M mutexes when opening the db by default. This will consume ~114 MiB memory according to our tests. This can be a waste of memory if most transactions are small. This number can be adjusted by OptimisticTransactionDBOptions.

Actual behavior

However, OptimisticTransactionDBOptions is not exposed in C API, unlike TransactionDBOptions:

https://github.com/facebook/rocksdb/blob/793a786fa3c16a2be782024446bd3f8bb5162875/include/rocksdb/c.h#L2744-L2753

https://github.com/facebook/rocksdb/blob/793a786fa3c16a2be782024446bd3f8bb5162875/include/rocksdb/c.h#L2459-L2470

This issue also makes #11439 to be unusable for other languages.

vjeko commented 1 year ago

This is a pretty big issue for us as well, as we're unable to modify OccValidationPolicy.