wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
530 stars 75 forks source link

terminate called after throwing instance of 'std::length_error' #51

Closed lookcrabs closed 7 years ago

lookcrabs commented 8 years ago

I have a ceph instance that recently had a power failure. All of the monitors use leveldb to store their data and all 3 of them seem to have a corrupt leveldb database in /var/lib/ceph/mon/ceph-$(hostname)/store.db. I found your library and tried running a repair in ipython which results in a crash::

In [4]: plyvel.repair_db('ceph-kh09-8/store.db/') terminate called after throwing an instance of 'std::length_error' what(): basic_string::_M_create [1] 13259 abort (core dumped) ipython

I was wondering if I am doing something wrong or if this is an error in the plyvel handler? It is my understanding that leveldb should skip keys with corruption and return any valid data from the remaining keys but I can't seem to open the databases at all.

wbolster commented 8 years ago

i think this has nothing to do with plyvel, since the repair_db() wrapper is a very thin one: https://github.com/wbolster/plyvel/blob/master/plyvel/_plyvel.pyx#L499-L518