Rust-rocksdb: column families do not work in conjunction with a merge operator

Created on 9 Oct 2015  ·  3Comments  ·  Source: rust-rocksdb/rust-rocksdb

This seems like it could also be an issue with the C API.

bug

Most helpful comment

For the folks who are seeing this bug: _How are you opening the database?_

I encountered the problem and did see it go away if I use DB::open_cf_descriptors(), instead of DB::open_cf(). I believe the underlying issue is that DB::open_cf() applies default Options to any column families it creates. Default Options will not include a merge operator.

Unless I'm mistaken:

  • RocksDB wants us to associate the merge operator individually to each column family, and not the entire database.
  • A fix (or workaround) when making use of column families & merge operators would be to use set_merge_operator() on the column family's Options, not the DB's Options. In order to do that, open_cf_descriptors() must be called instead of open_cf(). Hope this helps.

All 3 comments

What is the status on this bug? I dearly need this for a project of mine. Can I help with anything?

@tokahuke Unchanged since it was filed. What would help is confirmation on whether this is a bug with this Rust wrapper library, or if it is an issue with the upstream Facebook RocksDB library. If it is upstream, it's likely nothing we can address here and an issue would need to be opened against the upstream library.

For the folks who are seeing this bug: _How are you opening the database?_

I encountered the problem and did see it go away if I use DB::open_cf_descriptors(), instead of DB::open_cf(). I believe the underlying issue is that DB::open_cf() applies default Options to any column families it creates. Default Options will not include a merge operator.

Unless I'm mistaken:

  • RocksDB wants us to associate the merge operator individually to each column family, and not the entire database.
  • A fix (or workaround) when making use of column families & merge operators would be to use set_merge_operator() on the column family's Options, not the DB's Options. In order to do that, open_cf_descriptors() must be called instead of open_cf(). Hope this helps.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

f41gh7 picture f41gh7  ·  4Comments

alex88 picture alex88  ·  7Comments

rohitjoshi picture rohitjoshi  ·  10Comments

iSynaptic picture iSynaptic  ·  12Comments

elichai picture elichai  ·  6Comments