diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-02-27 00:59:35 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-02-27 00:59:35 -0800 |
| commit | f87f2045b34ed2ff593cfb6dba258463e560e3cb (patch) | |
| tree | 1c2a06726fb768b9088149ee01f635af950106cc | |
| parent | 757c7d67adaa58ca710bf39cfa87fd4fc23c756b (diff) | |
| download | seaweedfs-f87f2045b34ed2ff593cfb6dba258463e560e3cb.tar.xz seaweedfs-f87f2045b34ed2ff593cfb6dba258463e560e3cb.zip | |
delete old file first on windows
fix https://github.com/chrislusf/seaweedfs/issues/1210
| -rw-r--r-- | weed/storage/volume_vacuum.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index 34e3db66b..185484477 100644 --- a/weed/storage/volume_vacuum.go +++ b/weed/storage/volume_vacuum.go @@ -3,6 +3,7 @@ package storage import ( "fmt" "os" + "runtime" "time" "github.com/chrislusf/seaweedfs/weed/glog" @@ -111,6 +112,10 @@ func (v *Volume) CommitCompact() error { return e } } else { + if runtime.GOOS == "windows" { + os.RemoveAll(v.FileName() + ".dat") + os.RemoveAll(v.FileName() + ".idx") + } var e error if e = os.Rename(v.FileName()+".cpd", v.FileName()+".dat"); e != nil { return fmt.Errorf("rename %s: %v", v.FileName()+".cpd", e) |
