diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-10-25 07:20:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-25 07:20:00 -0700 |
| commit | 46cb692d834682fd3baedc3ec36b0117faad45cb (patch) | |
| tree | 4caa59d2722370704be89c751f5a47960c8f296c | |
| parent | da36abf0339661df99d3694cc4dd233f21c5cea3 (diff) | |
| parent | 2fb1fce8a07bd92fff03a34a17c3186aeca59a46 (diff) | |
| download | seaweedfs-46cb692d834682fd3baedc3ec36b0117faad45cb.tar.xz seaweedfs-46cb692d834682fd3baedc3ec36b0117faad45cb.zip | |
Merge pull request #1560 from kmlebedev/fix_stat_read_only_volumes
avoid old values when missing read only flags
| -rw-r--r-- | weed/storage/store.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go index 2cd237fcb..b9fcfcba9 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -222,6 +222,10 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat { collectionVolumeSize[v.Collection] += volumeMessage.Size if v.IsReadOnly() { collectionVolumeReadOnlyCount[v.Collection] += 1 + } else { + if _, exist := collectionVolumeReadOnlyCount[v.Collection]; !exist { + collectionVolumeReadOnlyCount[v.Collection] = 0 + } } } location.volumesLock.RUnlock() |
