clear splitstore dir before deleting, only warn if the latter fails

to address situations with symlinks
This commit is contained in:
vyzo 2021-08-03 15:39:48 +03:00 committed by Jennifer Wang
parent 3983dadf3a
commit d95fcd55bf

View File

@ -93,10 +93,16 @@ var splitstoreRollbackCmd = &cli.Command{
return xerrors.Errorf("error copying hotstore to coldstore: %w", err) return xerrors.Errorf("error copying hotstore to coldstore: %w", err)
} }
fmt.Println("clearing splitstore directory...")
err = clearSplitstoreDir(lr)
if err != nil {
return xerrors.Errorf("error clearing splitstore directory: %w", err)
}
fmt.Println("deleting splitstore directory...") fmt.Println("deleting splitstore directory...")
err = deleteSplitstoreDir(lr) err = deleteSplitstoreDir(lr)
if err != nil { if err != nil {
return xerrors.Errorf("error deleting splitstore directory: %w", err) log.Warnf("error deleting splitstore directory: %s", err)
} }
fmt.Println("deleting splitstore keys from metadata datastore...") fmt.Println("deleting splitstore keys from metadata datastore...")