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
This commit is contained in:
Chris Lu 2018-09-26 18:45:51 -07:00
parent 31ed352ab6
commit a362261972

View file

@ -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