Skip to content
Snippets Groups Projects
Commit fcbb9700 authored by Michael Adam's avatar Michael Adam Committed by Michael Adam
Browse files

db-upgrade: prevent upgrade from failing with orphaned brickid in volume


If a volume links back to a brick-id that does not
exist any more in the db, this does not harm otherwise,
so let's not have heketi refuse to start up in this
situation.

Signed-off-by: default avatarMichael Adam <obnox@redhat.com>
parent 1f26ccd0
No related branches found
No related tags found
No related merge requests found
......@@ -274,6 +274,12 @@ func addVolumeIdInBrickEntry(tx *bolt.Tx) error {
}
for _, brick := range volumeEntry.Bricks {
brickEntry, err := NewBrickEntryFromId(tx, brick)
if err == ErrNotFound {
logger.Warning("Volume [%v] links to "+
"nonexistent brick [%v]. Ignoring.",
volume, brick)
continue
}
if err != nil {
return err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment