From c9124bd1a94db7f68a1a9db867aa4f2a40eb0d63 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 3 Aug 2021 15:39:48 +0300 Subject: [PATCH] clear splitstore dir before deleting, only warn if the latter fails to address situations with symlinks --- cmd/lotus-shed/splitstore.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-shed/splitstore.go b/cmd/lotus-shed/splitstore.go index 49d703184..4f668888e 100644 --- a/cmd/lotus-shed/splitstore.go +++ b/cmd/lotus-shed/splitstore.go @@ -93,10 +93,16 @@ var splitstoreRollbackCmd = &cli.Command{ 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...") err = deleteSplitstoreDir(lr) 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...")