lib/db: Be more lenient during migration (fixes #6397) (#6398)

This commit is contained in:
Jakob Borg 2020-03-06 20:50:55 +01:00 committed by GitHub
parent 860ae7f395
commit 2faa1ad360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -453,7 +453,16 @@ func (db *schemaUpdater) updateSchemato9(prev int) error {
metas := make(map[string]*metadataTracker)
for it.Next() {
intf, err := t.unmarshalTrunc(it.Value(), false)
if err != nil {
if backend.IsNotFound(err) {
// Unmarshal error due to missing parts (block list), probably
// due to a bad migration in a previous RC. Drop this key, as
// getFile would anyway return this as a "not found" in the
// normal flow of things.
if err := t.Delete(it.Key()); err != nil {
return err
}
continue
} else if err != nil {
return err
}
fi := intf.(protocol.FileInfo)