Browse Source
fix: clean metric MasterReplicaPlacementMismatch for unregister volume (#5239)
pull/5246/head
Konstantin Lebedev
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
0 deletions
-
weed/topology/topology.go
|
|
@ -19,6 +19,7 @@ import ( |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/sequence" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/stats" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/storage" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/needle" |
|
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/super_block" |
|
|
@ -273,6 +274,9 @@ func (t *Topology) RegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode) { |
|
|
|
} |
|
|
|
func (t *Topology) UnRegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode) { |
|
|
|
glog.Infof("removing volume info: %+v from %v", v, dn.id) |
|
|
|
if v.ReplicaPlacement.GetCopyCount() > 1 { |
|
|
|
stats.MasterReplicaPlacementMismatch.WithLabelValues(v.Collection, v.Id.String()).Set(0) |
|
|
|
} |
|
|
|
diskType := types.ToDiskType(v.DiskType) |
|
|
|
volumeLayout := t.GetVolumeLayout(v.Collection, v.ReplicaPlacement, v.Ttl, diskType) |
|
|
|
volumeLayout.UnRegisterVolume(&v, dn) |
|
|
|