Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

db: fix recovery from unsynced metadata #555

Merged
merged 1 commit into from Apr 24, 2016
Merged

db: fix recovery from unsynced metadata #555

merged 1 commit into from Apr 24, 2016

Conversation

cyphar
Copy link
Contributor

@cyphar cyphar commented Apr 19, 2016

Bolt stores the two latest transactions' metadata, but previously did
not recover from validation failures in the latest by using the second
latest. Fix this by correctly handling validation failures in db.go, as
well as returning the metadata with highest txid which is also valid in
DB.meta().

Fixes: #548

Signed-off-by: Aleksa Sarai asarai@suse.de

/cc @benbjohnson

Bolt stores the two latest transactions' metadata, but previously did
not recover from validation failures in the latest by using the second
latest. Fix this by correctly handling validation failures in db.go, as
well as returning the metadata with highest txid which is also valid in
DB.meta().

Signed-off-by: Aleksa Sarai <asarai@suse.de>
@benbjohnson benbjohnson merged commit ef2f3ab into boltdb:master Apr 24, 2016
@benbjohnson
Copy link
Member

@cyphar Thanks! I added some tests for the change and tweaked some docs in a5aec31.

@cyphar cyphar deleted the 548-fix-errors-with-unsynced-metadata branch April 24, 2016 23:55
@cyphar cyphar mentioned this pull request May 16, 2016
@sigmonsays
Copy link

Is it safe to assume that the tests added will catch a regression if this type of crash (and corruption) occurs again?

@DaBlitzStein
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants