mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add logging
This commit is contained in:
parent
d8bb3845ae
commit
9b8f8f4bb9
|
@ -38,6 +38,7 @@ func (v *Volume) commitCompact() error {
|
||||||
}
|
}
|
||||||
//glog.V(3).Infof("Pretending to be vacuuming...")
|
//glog.V(3).Infof("Pretending to be vacuuming...")
|
||||||
//time.Sleep(20 * time.Second)
|
//time.Sleep(20 * time.Second)
|
||||||
|
glog.V(3).Infof("Loading Commit file...")
|
||||||
if e = v.load(true, false, v.needleMapKind); e != nil {
|
if e = v.load(true, false, v.needleMapKind); e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,12 +80,15 @@ func batchVacuumVolumeCommit(vl *VolumeLayout, vid storage.VolumeId, locationlis
|
||||||
return isCommitSuccess
|
return isCommitSuccess
|
||||||
}
|
}
|
||||||
func (t *Topology) Vacuum(garbageThreshold string) int {
|
func (t *Topology) Vacuum(garbageThreshold string) int {
|
||||||
|
glog.V(0).Infoln("Start vacuum on demand")
|
||||||
for _, col := range t.collectionMap.Items {
|
for _, col := range t.collectionMap.Items {
|
||||||
c := col.(*Collection)
|
c := col.(*Collection)
|
||||||
|
glog.V(0).Infoln("vacuum on collection:", c.Name)
|
||||||
for _, vl := range c.storageType2VolumeLayout.Items {
|
for _, vl := range c.storageType2VolumeLayout.Items {
|
||||||
if vl != nil {
|
if vl != nil {
|
||||||
volumeLayout := vl.(*VolumeLayout)
|
volumeLayout := vl.(*VolumeLayout)
|
||||||
for vid, locationlist := range volumeLayout.vid2location {
|
for vid, locationlist := range volumeLayout.vid2location {
|
||||||
|
glog.V(0).Infoln("vacuum on collection:", c.Name, "volume", vid)
|
||||||
if batchVacuumVolumeCheck(volumeLayout, vid, locationlist, garbageThreshold) {
|
if batchVacuumVolumeCheck(volumeLayout, vid, locationlist, garbageThreshold) {
|
||||||
if batchVacuumVolumeCompact(volumeLayout, vid, locationlist) {
|
if batchVacuumVolumeCompact(volumeLayout, vid, locationlist) {
|
||||||
batchVacuumVolumeCommit(volumeLayout, vid, locationlist)
|
batchVacuumVolumeCommit(volumeLayout, vid, locationlist)
|
||||||
|
|
|
@ -77,7 +77,7 @@ func (ms *MasterServer) volumeVacuumHandler(w http.ResponseWriter, r *http.Reque
|
||||||
if gcThreshold == "" {
|
if gcThreshold == "" {
|
||||||
gcThreshold = ms.garbageThreshold
|
gcThreshold = ms.garbageThreshold
|
||||||
}
|
}
|
||||||
debug("garbageThreshold =", gcThreshold)
|
glog.Infoln("garbageThreshold =", gcThreshold)
|
||||||
ms.Topo.Vacuum(gcThreshold)
|
ms.Topo.Vacuum(gcThreshold)
|
||||||
ms.dirStatusHandler(w, r)
|
ms.dirStatusHandler(w, r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue