aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-09-26 18:45:51 -0700
committerChris Lu <chris.lu@gmail.com>2018-09-26 18:45:51 -0700
commita36226197241194823ca4ccad03a9d62ae11c82a (patch)
tree01e94c30bcae29181f093d245ee6b6a834743263
parent31ed352ab638027e940ff92af55c0c6db0dc3309 (diff)
downloadseaweedfs-a36226197241194823ca4ccad03a9d62ae11c82a.tar.xz
seaweedfs-a36226197241194823ca4ccad03a9d62ae11c82a.zip
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
-rw-r--r--weed/storage/volume_vacuum.go4
1 files changed, 4 insertions, 0 deletions
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