mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-21 08:17:57 +08:00
adjust logging
This commit is contained in:
@@ -18,7 +18,7 @@ func (v *Volume) garbageLevel() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Volume) Compact(preallocate int64) error {
|
func (v *Volume) Compact(preallocate int64) error {
|
||||||
glog.V(3).Infof("Compacting ...")
|
glog.V(3).Infof("Compacting volume %d ...", v.Id)
|
||||||
//no need to lock for copy on write
|
//no need to lock for copy on write
|
||||||
//v.accessLock.Lock()
|
//v.accessLock.Lock()
|
||||||
//defer v.accessLock.Unlock()
|
//defer v.accessLock.Unlock()
|
||||||
@@ -32,23 +32,23 @@ func (v *Volume) Compact(preallocate int64) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Volume) Compact2() error {
|
func (v *Volume) Compact2() error {
|
||||||
glog.V(3).Infof("Compact2 ...")
|
glog.V(3).Infof("Compact2 volume %d ...", v.Id)
|
||||||
filePath := v.FileName()
|
filePath := v.FileName()
|
||||||
glog.V(3).Infof("creating copies for volume %d ...", v.Id)
|
glog.V(3).Infof("creating copies for volume %d ...", v.Id)
|
||||||
return v.copyDataBasedOnIndexFile(filePath+".cpd", filePath+".cpx")
|
return v.copyDataBasedOnIndexFile(filePath+".cpd", filePath+".cpx")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *Volume) commitCompact() error {
|
func (v *Volume) commitCompact() error {
|
||||||
glog.V(0).Infof("Committing vacuuming...")
|
glog.V(0).Infof("Committing volume %d vacuuming...", v.Id)
|
||||||
v.dataFileAccessLock.Lock()
|
v.dataFileAccessLock.Lock()
|
||||||
defer v.dataFileAccessLock.Unlock()
|
defer v.dataFileAccessLock.Unlock()
|
||||||
glog.V(3).Infof("Got Committing lock...")
|
glog.V(3).Infof("Got volume %d committing lock...", v.Id)
|
||||||
v.nm.Close()
|
v.nm.Close()
|
||||||
_ = v.dataFile.Close()
|
_ = v.dataFile.Close()
|
||||||
|
|
||||||
var e error
|
var e error
|
||||||
if e = v.makeupDiff(v.FileName()+".cpd", v.FileName()+".cpx", v.FileName()+".dat", v.FileName()+".idx"); e != nil {
|
if e = v.makeupDiff(v.FileName()+".cpd", v.FileName()+".cpx", v.FileName()+".dat", v.FileName()+".idx"); e != nil {
|
||||||
glog.V(0).Infof("makeupDiff in commitCompact failed %v", e)
|
glog.V(0).Infof("makeupDiff in commitCompact volume %d failed %v", v.Id, e)
|
||||||
e = os.Remove(v.FileName() + ".cpd")
|
e = os.Remove(v.FileName() + ".cpd")
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return e
|
return e
|
||||||
@@ -73,7 +73,7 @@ func (v *Volume) commitCompact() error {
|
|||||||
os.RemoveAll(v.FileName() + ".ldb")
|
os.RemoveAll(v.FileName() + ".ldb")
|
||||||
os.RemoveAll(v.FileName() + ".bdb")
|
os.RemoveAll(v.FileName() + ".bdb")
|
||||||
|
|
||||||
glog.V(3).Infof("Loading Commit file...")
|
glog.V(3).Infof("Loading volume %d commit file...", v.Id)
|
||||||
if e = v.load(true, false, v.needleMapKind, 0); e != nil {
|
if e = v.load(true, false, v.needleMapKind, 0); e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ func (v *Volume) commitCompact() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Volume) cleanupCompact() error {
|
func (v *Volume) cleanupCompact() error {
|
||||||
glog.V(0).Infof("Cleaning up vacuuming...")
|
glog.V(0).Infof("Cleaning up volume %d vacuuming...", v.Id)
|
||||||
|
|
||||||
e1 := os.Remove(v.FileName() + ".cpd")
|
e1 := os.Remove(v.FileName() + ".cpd")
|
||||||
e2 := os.Remove(v.FileName() + ".cpx")
|
e2 := os.Remove(v.FileName() + ".cpx")
|
||||||
|
Reference in New Issue
Block a user