Open oersted opened 5 years ago
@oersted
Did you try pybind11
branch (https://github.com/twmht/python-rocksdb/tree/pybind11)? It should provide most of the features including stable close function.
And also let me know if there are any features you want but not in the branch.
Thank you, yes I did take a look at pybind11, I was not sure how stable it was. I am currently using the merge operations heavily and I can't find them in the docs at first sight. Are they implemented?
I have also experimented with plain get-put instead of merge, and it seems to work well, so I might try pybind11 anyways.
Yup, merge operators are still missing features in pybind11 branch. But I will add it as soon as possible.
@twmht How is progress on merge operators in pybind11? I have managed to get around this until now, but it is becoming a more important performance bottleneck.
@oersted
yes. It's almost done. Just need some more unit test. The update will be as soon as possible.
@twmht Thanks :)
Hello again @twmht. I thought we figured out how to do this properly, but it looks like it is not fully reliable, weird stuff happens when closing the DB at large scale.
Anyways, I would really appreciate it if you gave a look at finalizing the Merge API for pybind11. I have 2 developers here that can help you if needed, this is fairly critical to our work now.
Any update on this @twmht @oersted ? Being able to close the database would be lovely :)
@maxibor I found that @iFA88 created a fork (https://github.com/iFA88/python-rocksdb) that fixed this issue. Original thread: #46. I repost it here to increase visibility.
I experience a hard crash when closing a DB.
I have experimented with a number of diverse settings. No matter the load or the contents of the database it always seems to happen.
This is the case both in master with Python 3 and in Python 2 with the fix from #40. I also tested with both librocksdb-dev 5.17 (from Debian stretch-backports) and the facebook/rocksdb master (>6.1.2).
At one point I got a detailed stack trace and memory map but I can't seem to recover them. I will edit this post if I can produce them later on. I do know that the error was "double free or corruption".
Closing a DB is a critical feature for my use case. I need to be able to reliably populate DBs in subprocesses and transfer the control to the master process afterwards. This is not possible unless the database is properly closed before the transfer. I have tried the
del db; gc.collect()
strategy from #10 and the unit tests, but, as expected,del
is not deterministic and the file lock is not freed in most cases. In any case, ifdel
run it would likely also crash in theclose()
method.I believe #46 might be experiencing the same issue.
Please, let me know if this is the case for everyone or if it is an environment issue.