Skip to content

Commit

Permalink
volume: more context when failing to initialize
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Aug 1, 2023
1 parent aa92ca4 commit d0086b6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions volume/vinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Init(t cluster.Target, config *cmn.Config,
// a) local-config is kept in-sync with mountpath changes (see ais/fspathgrp)
// b) disk label for absolute referencing - can wait (TODO)
if v, err := configLoadVMD(tid, config.FSP.Paths); err != nil {
cos.ExitLogf("%s: %v", t, err)
cos.ExitLogf("%s: %v (config-load-vmd, %v)", t, err, config.FSP.Paths.ToSlice())
} else {
vmd = v
}
Expand All @@ -41,11 +41,11 @@ func Init(t cluster.Target, config *cmn.Config,
// b) when the config doesn't contain a single valid mountpath
// (that in turn contains a copy of VMD, possibly outdated (but that's ok))
if err := configInitMPI(tid, config); err != nil {
cos.ExitLogf("%s: %v", t, err)
cos.ExitLogf("%s: %v (config-init-mpi, %v)", t, err, config.FSP.Paths.ToSlice())
}
nlog.Warningf("%s: creating new VMD from %v config", t, config.FSP.Paths.ToSlice())
if v, err := NewFromMPI(tid); err != nil {
cos.ExitLogf("%s: %v", t, err)
cos.ExitLogf("%s: %v (new-from-mpi)", t, err) // unlikely
} else {
vmd = v
}
Expand All @@ -58,7 +58,7 @@ func Init(t cluster.Target, config *cmn.Config,
// initialize MPI
var persist bool
if v, haveOld, err := vmdInitMPI(tid, config, vmd, 1 /*pass #1*/, ignoreMissingMountpath); err != nil {
cos.ExitLogf("%s: %v", t, err)
cos.ExitLogf("%s: %v (vmd-init-mpi-p1, ignore-missing=%t, %s)", t, err, ignoreMissingMountpath, vmd)
} else {
if v != nil && v.Version > vmd.Version {
vmd = v
Expand All @@ -68,7 +68,8 @@ func Init(t cluster.Target, config *cmn.Config,
persist = true
}
if v, _, err := vmdInitMPI(tid, config, vmd, 2 /*pass #2*/, ignoreMissingMountpath); err != nil {
cos.ExitLogf("%s: %v", t, err)
cos.ExitLogf("%s: %v (vmd-init-mpi-p2, have-old=%t, ignore-missing=%t, %s)",
t, err, haveOld, ignoreMissingMountpath, vmd)
} else {
debug.Assert(v == nil || v.Version == vmd.Version)
}
Expand Down Expand Up @@ -142,8 +143,7 @@ rerr:
}

// VMD => MPI in two passes
func vmdInitMPI(tid string, config *cmn.Config, vmd *VMD, pass int, ignoreMissingMountpath bool) (maxVerVMD *VMD,
haveOld bool, err error) {
func vmdInitMPI(tid string, config *cmn.Config, vmd *VMD, pass int, ignoreMissingMountpath bool) (maxVerVMD *VMD, haveOld bool, err error) {
var (
availablePaths = make(fs.MPI, len(vmd.Mountpaths))
disabledPaths = make(fs.MPI)
Expand Down

0 comments on commit d0086b6

Please sign in to comment.