mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add writable checking
fix https://github.com/chrislusf/seaweedfs/issues/405
This commit is contained in:
parent
dcaf1796fe
commit
9ba52db585
|
@ -86,7 +86,14 @@ func (t *Topology) Vacuum(garbageThreshold string) int {
|
||||||
for _, vl := range c.storageType2VolumeLayout.Items() {
|
for _, vl := range c.storageType2VolumeLayout.Items() {
|
||||||
if vl != nil {
|
if vl != nil {
|
||||||
volumeLayout := vl.(*VolumeLayout)
|
volumeLayout := vl.(*VolumeLayout)
|
||||||
|
writableSet := make(map[storage.VolumeId]bool)
|
||||||
|
for _, id := range volumeLayout.writables {
|
||||||
|
writableSet[id] = true
|
||||||
|
}
|
||||||
for vid, locationlist := range volumeLayout.vid2location {
|
for vid, locationlist := range volumeLayout.vid2location {
|
||||||
|
if _, isWritable := writableSet[vid]; !isWritable {
|
||||||
|
continue
|
||||||
|
}
|
||||||
glog.V(0).Infof("check vacuum on collection:%s volume:%d", c.Name, vid)
|
glog.V(0).Infof("check vacuum on collection:%s volume:%d", c.Name, vid)
|
||||||
if batchVacuumVolumeCheck(volumeLayout, vid, locationlist, garbageThreshold) {
|
if batchVacuumVolumeCheck(volumeLayout, vid, locationlist, garbageThreshold) {
|
||||||
if batchVacuumVolumeCompact(volumeLayout, vid, locationlist) {
|
if batchVacuumVolumeCompact(volumeLayout, vid, locationlist) {
|
||||||
|
|
Loading…
Reference in a new issue