stats master_replica_placement_mismatch
This commit is contained in:
@@ -3,6 +3,7 @@ package topology
|
||||
import (
|
||||
"errors"
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/stats"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
||||
@@ -246,6 +247,14 @@ func (n *NodeImpl) CollectDeadNodeAndFullVolumes(freshThreshHold int64, volumeSi
|
||||
} else if float64(v.Size) > float64(volumeSizeLimit)*growThreshold {
|
||||
n.GetTopology().chanCrowdedVolumes <- v
|
||||
}
|
||||
copyCount := v.ReplicaPlacement.GetCopyCount()
|
||||
if copyCount > 1 {
|
||||
if copyCount > len(n.GetTopology().Lookup(v.Collection, v.Id)) {
|
||||
stats.MasterReplicaPlacementMismatch.WithLabelValues(v.Collection, v.Id.String()).Set(1)
|
||||
} else {
|
||||
stats.MasterReplicaPlacementMismatch.WithLabelValues(v.Collection, v.Id.String()).Set(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user