pyrocksdb icon indicating copy to clipboard operation
pyrocksdb copied to clipboard

Added support for column families

Open grove opened this issue 10 years ago • 3 comments

This should fix issue #34.

grove avatar Nov 19 '15 19:11 grove

@stephan-hof could you please merge this?

(@grove thanks for doing the work!)

elad avatar May 19 '16 06:05 elad

The problem with this implementation of column families is that in the latest rocksdb holding a handle to a column family and closing the DB will cause an assert failure in rocksdb. While this behavior is acceptable in C++. It is unacceptable in python that anything would ever cause a segfault. My Suggestion is that instead of having a object that holds onto column families that you just return a str that the db object knows how to turn back into a handle. So in the db dealloc it can clear its mapping from str to handle and no abort is possible.

fried avatar Feb 06 '17 19:02 fried

Well spotted. I agree.

I've also noticed a related issue[1]. If a column family is deleted and then later some other thread tries to use it, then the database enters read-only mode(!). In this case it is really important to manage the life-cycle of the column family handles.

I'm not sure if pyrocksdb have an API for closing the DB right now. Maybe it's relying on the garbage collector to kick in for that to happen automatically?

[1] https://github.com/facebook/rocksdb/issues/592

grove avatar Feb 07 '17 08:02 grove