SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
collection Volume ReadOnly Count with detailed status
Konstantin Lebedev1ad1b8c4f63f
diff --git a/weed/storage/store.go b/weed/storage/store.goindex b9fcfcba99..3a8c07e6ed 100644--- a/weed/storage/store.go+++ b/weed/storage/store.go@@ -200,7 +200,7 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {maxVolumeCount := 0var maxFileKey NeedleIdcollectionVolumeSize := make(map[string]uint64)- collectionVolumeReadOnlyCount := make(map[string]uint8)+ collectionVolumeReadOnlyCount := make(map[string]map[string]uint8)for _, location := range s.Locations {var deleteVids []needle.VolumeIdmaxVolumeCount = maxVolumeCount + location.MaxVolumeCount@@ -220,11 +220,25 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {}}collectionVolumeSize[v.Collection] += volumeMessage.Size+ if _, exist := collectionVolumeReadOnlyCount[v.Collection]; !exist {+ collectionVolumeReadOnlyCount[v.Collection] = map[string]uint8{+ "IsReadOnly": 0,+ "noWriteOrDelete": 0,+ "noWriteCanDelete": 0,+ "isDiskSpaceLow": 0,+ }+ }if v.IsReadOnly() {- collectionVolumeReadOnlyCount[v.Collection] += 1- } else {- if _, exist := collectionVolumeReadOnlyCount[v.Collection]; !exist {- collectionVolumeReadOnlyCount[v.Collection] = 0+ collectionVolumeReadOnlyCount[v.Collection] = make(map[string]uint8)+ collectionVolumeReadOnlyCount[v.Collection]["IsReadOnly"] += 1+ if v.noWriteOrDelete {+ collectionVolumeReadOnlyCount[v.Collection]["noWriteOrDelete"] += 1+ }+ if v.noWriteCanDelete {+ collectionVolumeReadOnlyCount[v.Collection]["noWriteCanDelete"] += 1+ }+ if v.location.isDiskSpaceLow {+ collectionVolumeReadOnlyCount[v.Collection]["isDiskSpaceLow"] += 1}}}@@ -251,8 +265,10 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {stats.VolumeServerDiskSizeGauge.WithLabelValues(col, "normal").Set(float64(size))}- for col, count := range collectionVolumeReadOnlyCount {- stats.VolumeServerReadOnlyVolumeGauge.WithLabelValues(col, "normal").Set(float64(count))+ for col, types := range collectionVolumeReadOnlyCount {+ for t, count := range types {+ stats.VolumeServerReadOnlyVolumeGauge.WithLabelValues(col, t).Set(float64(count))+ }}return &master_pb.Heartbeat{