From a36226197241194823ca4ccad03a9d62ae11c82a Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 26 Sep 2018 18:45:51 -0700 Subject: [PATCH] avoid possible racing issue if leveldb or boltdb is used. remove the to-be-generated files during commit fix https://github.com/chrislusf/seaweedfs/issues/738 --- weed/storage/volume_vacuum.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index ba3ab6735..d8a58e35c 100644 --- a/weed/storage/volume_vacuum.go +++ b/weed/storage/volume_vacuum.go @@ -69,6 +69,10 @@ func (v *Volume) commitCompact() error { //glog.V(3).Infof("Pretending to be vacuuming...") //time.Sleep(20 * time.Second) + + os.RemoveAll(v.FileName() + ".ldb") + os.RemoveAll(v.FileName() + ".bdb") + glog.V(3).Infof("Loading Commit file...") if e = v.load(true, false, v.needleMapKind, 0); e != nil { return e