Skip to content

Commit

Permalink
Don’t stop daemon on migration hard failure
Browse files Browse the repository at this point in the history
Also changes missing storage layer for container
RWLayer to a soft failure.

Fixes moby#20147

Signed-off-by: Tonis Tiigi <[email protected]>
(cherry picked from commit 2798d7a)
  • Loading branch information
tonistiigi authored and Tibor Vass committed Feb 17, 2016
1 parent 50a498e commit 55080fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo

migrationStart := time.Now()
if err := v1.Migrate(config.Root, graphDriver, d.layerStore, d.imageStore, referenceStore, distributionMetadataStore); err != nil {
return nil, err
logrus.Errorf("Graph migration failed: %q. Your old graph data was found to be too inconsistent for upgrading to content-addressable storage. Some of the old data was probably not upgraded. We recommend starting over with a clean storage directory if possible.", err)
}
logrus.Infof("Graph migration to content-addressability took %.2f seconds", time.Since(migrationStart).Seconds())

Expand Down
2 changes: 1 addition & 1 deletion layer/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (ls *layerStore) CreateRWLayerByGraphID(name string, graphID string, parent
}

if !ls.driver.Exists(graphID) {
return errors.New("graph ID does not exist")
return fmt.Errorf("graph ID does not exist: %q", graphID)
}

var p *roLayer
Expand Down
3 changes: 2 additions & 1 deletion migrate/v1/migratev1.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ func migrateContainers(root string, ls graphIDMounter, is image.Store, imageMapp
}

if err := ls.CreateRWLayerByGraphID(id, id, img.RootFS.ChainID()); err != nil {
return err
logrus.Errorf("migrate container error: %v", err)
continue
}

logrus.Infof("migrated container %s to point to %s", id, imageID)
Expand Down

0 comments on commit 55080fc

Please sign in to comment.