facebook / rocksdb

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

Impossible to iterate over non-default column family updates in WriteBatch using C API. #12790

Open konstantinvilin opened 1 week ago

konstantinvilin commented 1 week ago

WriteBatch Iterator exposed via C API does not allow column family specific operations: put_cf, delete_cf and merge_cf. This is required when the one needs to read changes for any non-default column family. Without that functionality it is impossible to iterate over changes in WAL that are relevant to custom column families.

Expected behavior

WriteBatch iterator in C API allows walking through non-default column family changes.

Actual behavior

WriteBatch iterator in C API only iterates over default column family changes.

Steps to reproduce the behavior

  1. Create WriteBatch and use put_cf, merge_cf or delete_cf to apply changes to a non-default column family.
  2. Use rocksdb_writebatch_iterate C API function to iterate over WriteBatch.
konstantinvilin commented 1 week ago

I've submitted PR with a fix: https://github.com/facebook/rocksdb/pull/12718

Could someone review it, please?