stephan-hof / pyrocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
150 stars 169 forks source link

repair damaged DB? #31

Closed alekibango closed 9 years ago

alekibango commented 9 years ago

Is it possible to repair DB which is not ok? For example when we are having some files unreadable or missing...

How?

stephan-hof commented 9 years ago

I have seen there is a function called RepairDB, but honestly I don't know to which degree it can repair the database. Please talk to the rocksdb people directly. I wrapped the function, see here: 8fba5ffa1dd2d4a6b40387a239343c43666bd040

alekibango commented 9 years ago

hi, thanks for answer.

Problem is, in python3, which is my primary platform now, the function repair_db is missing from namespace. Not yet sure why.

stephan-hof commented 9 years ago

Hmm are you rusing the 'master branch' having the commit I mentioned ?

I recompiled pyrocksdb with python 3.4 and for me it works

import rocksdb
options = rocksdb.Options()
# ... code to configre the options
rocksdb.repair_db('/tmp/test', options)