-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Data lost on crash #740
Comments
@fpessolano Badger writes all values (create/update) to the @mangalaman93 Please correct me if I'm wrong. |
@jarifibrahim looks correct. It also depends whether the call to read, write has been completed before server crashed. If not, the writes may not be visible on disk. |
There's an open bounty for data loss: #601 . |
Well, I have just covered with recover various crashes as well as system signals interruption since I noticed that data was not being saved to the disk. |
The data, as @jarifibrahim mentioned, gets written to value log first. Then makes its way to LSM tree. On a crash, the value log gets replayed. You can test out accessing data via APIs, it would be there. Feel free to reopen the issue, if you can't find it. |
If the app crashes and I re-open the database again (by restarting the
app itself), the data appear absent.
It might be in the vlog, but if I try to access it, it appear as
missing. Do i need to force vlog reloading on open as well?
On 3/18/2019 2:23 PM, Manish R Jain wrote:
The data as @jarifibrahim <https://github.com/jarifibrahim> mentioned,
data gets written to value log first. Then makes its way to LSM tree.
On a crash, the value log gets replayed. You can test out accessing
data via APIs, it would be there. Feel free to reopen the issue, if
you can't find it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#740 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkRIL2UQRmxPOhCeBhjFUmP9vPxmIzcks5vX5NggaJpZM4b2p5X>.
--
Francesco Pessolano
About me: www.linkedin.com/in/fpessolano
My Photography: 500px.com/fpessolano
|
If you can share a code snippet, we can try to identify your issue. Most likely, it is with how you're writing or accessing data, than an issue in Badger itself. |
Sure, the read snippets is quite basic:
And the write also:
some parameters are rom the (not copied) enclosing code of course ... |
I have only started looking at Badger today but am not finding it resilient to program crashing. With simple code similar to above, my app works well..... but if I crash my app (or just stop termination from Goland) the database does not work when I next start it. In effect I have lost all my database because badger does not recover from the crash. The only way I can get things working again is to stop, delete the database and restart. Any data in the database is effectively lost because the app will not restart. Log shows the following: Each attempt to access the database is then blocked. The problem is that it blocks in the function WaitForMark in watermark.go - so any process trying to access the db freezes. Crashing without calling .Close() should not leave the database unable to recover so completely when it restarts. |
You need to turn on the truncate flag from default options, so Badger can truncate the value log slightly to bring it back to the point up until which all the entries are correctly check summed. |
Amazing, that seems to work perfectly. So perfectly I would have thought this should be the default.. I just searched the main page and I don't think this is mentioned anywhere prominent!.. Anyhow - thanks so much for the pointer, it looks like it takes badger from a bit disappointing to probably the best solution for my app! |
Badger is pretty good, my apologies for not posting what manishrjain to point out the solution to ym original post. |
Sorry to reopen this case, but on a product database we had an hard crash (electrricity went out) and we lost data. Truncate is true and syncwrite are botjh true, how can we prevent this from happening again? PS: as this is deployed we have to stick to version 1.5.5 |
It used to be the default, but we heard a complain from IPFS folks. They wanted to have an option to not truncate and get involved manually.
Shouldn't be the case for any write which has executed successfully. Unless the disk itself got corrupted? |
I opened a new issue with all the settings i use, just in case. We are exploring if the client disk got corrupted as well. |
I am using default options (thus syncwrite is true), if my server die normally and the database is closed, all data is saved to disk. If the server crashes (or I interrupt it) in a non serviceable manner, no data is written to the disk.
Is there a way to force data to be immediately written to the disk so that no data would be lost in case of a non serviceable server crash?
Thanks
The text was updated successfully, but these errors were encountered: