0

we are using mapdb to store a list of files that have been visited during a long running process, so that if we need to abort or if the process crashes we can resume where we left off.

we want to protect against crashes corrupting our mapdb file store.

so we are using transactions where we periodically commit changes to disk.

but then i noticed something interesting that if we crash our process in certain times we still get the error

Header checksum broken. Store was not closed correctly and might be corrupted. Use DBMaker.checksumHeaderBypass() to recover your data. Use clean shutdown or enable transactions to protect the store in the future.

But indeed setting the checksumHeaderBypass makes the error go away. What is the cost of using this checksumHeaderBypass setting?

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152

2 Answers2

1

If you use mapdb from @postcontruct in springboot app it throws this error. Avoid initialising mapdb before the app started (don't initialize from @postconstruct).

Sandeep Kumar
  • 2,397
  • 5
  • 30
  • 37
Aishwarya
  • 26
  • 1
0

Not getting any traffic here because there are note a whole lot of mapdb people on sof. So i'll post the answer I think is the best

Basically if you allow checksum header bypass you can load the mapdb but it may have invalid entries in the mapdb. because if the checksum doesn't match, that indicates the content isn't what it should be. so you'll likely have some bad data in the mapdb. depending how often you commit to storage, could result in a lot or a little corrupted data.

Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152