Badger: value log truncate required to run db. this might result in data loss

Created on 20 Mar 2019  路  3Comments  路  Source: dgraph-io/badger

value log truncate required to run db. this might result in data loss
Win7 will be prompted
Mac can start normally

Most helpful comment

@manishrjain shouldn't this at least be documented? The readme doesn't mention the word "truncate" at all. The only options documented are about memory usage.

This happens every time you kill a process that has a badger store still open. I'd say this happens to everyone who starts tinkering around with BadgerDB on Windows. In order to avoid that you need to implement a "graceful shutdown" first, which at least I did only a little later on.

Wouldn't it be an option to enable this option on Windows by default? Or do truncating once a broken store should be opened? Once you're in this situation there are only two choices (I can think of):

1) Enable the Truncate option and risk data loss*
1) Delete the entire store and start from scratch.

*) What data exactly? The data from not closed transactions or something like that (which would be kind of predictable) or more random data across the entire store (because everything got really unstable and hard to recover from)?

Often the second choice is not an option, especially in production. While development it might be okay, though.

All 3 comments

You might need to enable the Truncate option to get past this. Windows has an issue, that I don't recall right now, which causes Badger to require truncation.

@manishrjain shouldn't this at least be documented? The readme doesn't mention the word "truncate" at all. The only options documented are about memory usage.

This happens every time you kill a process that has a badger store still open. I'd say this happens to everyone who starts tinkering around with BadgerDB on Windows. In order to avoid that you need to implement a "graceful shutdown" first, which at least I did only a little later on.

Wouldn't it be an option to enable this option on Windows by default? Or do truncating once a broken store should be opened? Once you're in this situation there are only two choices (I can think of):

1) Enable the Truncate option and risk data loss*
1) Delete the entire store and start from scratch.

*) What data exactly? The data from not closed transactions or something like that (which would be kind of predictable) or more random data across the entire store (because everything got really unstable and hard to recover from)?

Often the second choice is not an option, especially in production. While development it might be okay, though.

Okay, I just stumbled over issue #434. This explains why truncation shouldn't be done automatically.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

godeater picture godeater  路  3Comments

whyrusleeping picture whyrusleeping  路  8Comments

dwoske picture dwoske  路  7Comments

jackmiller334 picture jackmiller334  路  7Comments

ty2 picture ty2  路  7Comments