Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible/reasonnable to repair the database while in use? #237

Closed
julien-f opened this issue Nov 19, 2015 · 6 comments
Closed

Is it possible/reasonnable to repair the database while in use? #237

julien-f opened this issue Nov 19, 2015 · 6 comments
Labels
question Support or open question(s)

Comments

@julien-f
Copy link

No description provided.

@ralphtheninja ralphtheninja changed the title [Question] Is it possible/reasonnable to repair the database while in use? Is it possible/reasonnable to repair the database while in use? Nov 19, 2015
@ralphtheninja ralphtheninja added the question Support or open question(s) label Nov 19, 2015
@ralphtheninja
Copy link
Member

@julien-f Why would you need to repair a db that is in use?

@julien-f
Copy link
Author

The documentation says that this can also be used to compact the database.

Anyway my question is more: should I protect my users against repairing while the db is in use because leveldown/leveldb does not guard against it?

@ralphtheninja
Copy link
Member

Anyway my question is more: should I protect my users against repairing while the db is in use because leveldown/leveldb does not guard against it?

Good question. Not sure how you could guard against it though.

@No9
Copy link
Contributor

No9 commented Nov 19, 2015

@julien-f that sounds like the type of feature that @rescrv might have in https://github.com/rescrv/HyperLevelDB but he would need to confirm (of Deny)

@tacticalchihuahua
Copy link

@julien-f it's been awhile, but if you are using repair() to trigger compaction, better use compactRange() instead as a database repair has other side effects and should not be performed on an open database. the compactRange method can be called on an open database.

@leland-kwong
Copy link

leland-kwong commented Jan 29, 2018

Edit: I realized I could just use the range of keys that were deleted to do the compaction.

Is there a way to call compactRange so that we can compact everything? In particular, the keys can vary both by type and value, so I'm wondering if we can do something like compactRange('*', '*', cb)?

The main use case here is to compact a database when all the data has been removed. I noticed without compaction, a good bit of .ldb files still remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support or open question(s)
Projects
None yet
Development

No branches or pull requests

5 participants