Browse Source

ensure error checking on windows

tikv
Chris Lu 5 years ago
parent
commit
d3e1ef64b3
  1. 12
      weed/storage/volume_vacuum.go

12
weed/storage/volume_vacuum.go

@ -113,8 +113,14 @@ func (v *Volume) CommitCompact() error {
} }
} else { } else {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
os.RemoveAll(v.FileName() + ".dat")
os.RemoveAll(v.FileName() + ".idx")
e = os.RemoveAll(v.FileName() + ".dat")
if e != nil {
return e
}
e = os.RemoveAll(v.FileName() + ".idx")
if e != nil {
return e
}
} }
var e error var e error
if e = os.Rename(v.FileName()+".cpd", v.FileName()+".dat"); e != nil { if e = os.Rename(v.FileName()+".cpd", v.FileName()+".dat"); e != nil {
@ -414,7 +420,7 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
return fmt.Errorf("cannot append needle: %s", err) return fmt.Errorf("cannot append needle: %s", err)
} }
newOffset += n.DiskSize(version) newOffset += n.DiskSize(version)
glog.V(3).Infoln("saving key", n.Id, "volume offset", offset, "=>", newOffset, "data_size", n.Size)
glog.V(4).Infoln("saving key", n.Id, "volume offset", offset, "=>", newOffset, "data_size", n.Size)
return nil return nil
}) })

Loading…
Cancel
Save