-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Provide a way to truncate a corrupted Badger DB #5275
Comments
Will this small amount include "synced" data? If so, and if there's no way for us to actually sync the data, we should move to a different datastore. If not, we should just truncate by default. Explicitly, I'd expect the following semantics:
|
It shouldn't if |
We need some commit point. Some point where we can know that the data has been persisted. |
Sorry for the delay here, completing @bigs notes from the Dev meeting, if The (@manishrjain Feel free to ignore this but if you can would you mind validating that what I'm saying in this last paragraph is correct?) |
Yes, that understanding is correct. If it was applied successfully to the value log, it would be replayed back after crash. |
So, it looks like, given the semantics we expect, we should always enable truncation if SyncWrites is enabled. |
@schomatis do you have time to fix this as we discussed? That is:
|
Yes, I'll try to get to it next week.
Could you point me to the part of the code that generates the |
You'll need to add something to the profile here: https://github.com/ipfs/go-ipfs-config/blob/235aea7b2426fa745412285d1d2a4a129ed564a5/profile.go#L123 Document it in: https://github.com/ipfs/go-ipfs/blob/master/docs/datastores.md#badgerds And handle the configuration here: https://github.com/ipfs/go-ipfs/blob/4fb2666a2463bf0f17e21d3e02f176a5eb917745/repo/fsrepo/datastores.go#L341-L412 |
@djdv or @schomatis can we try to move forward on this? |
Yes, sorry, totally forgot about this one. |
* AutoRelay options for #5785. * Badger truncate-by-default option for #5275, #5625. License: MIT Signed-off-by: Steven Allen <[email protected]>
Badger needs explicit consent from the user to truncate a corrupted DB when starting: passing a
--truncate
flag. That flag is not being provided as an option right now and the user gets errors like:(and #5213 (comment)), which are not really useful.
Documentation should also be added as it's a normal scenario to have a (relatively small) portion of the DB corrupted after a crash.
The text was updated successfully, but these errors were encountered: