diff options
author | andrew-rykov <arykov@ydb.tech> | 2023-09-04 17:03:58 +0300 |
---|---|---|
committer | andrew-rykov <arykov@ydb.tech> | 2023-09-04 17:26:49 +0300 |
commit | 9d7eb61fa52b47766c6fb632783c4b1736a99aa5 (patch) | |
tree | faa3065cc174b7300cd0d5960d5b82e4b1877f31 | |
parent | f95a0eda68bb3a9532f4bcf221662e9abec6b672 (diff) | |
download | ydb-9d7eb61fa52b47766c6fb632783c4b1736a99aa5.tar.gz |
storage v2 strange degraded
-rw-r--r-- | ydb/core/viewer/json_storage.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ydb/core/viewer/json_storage.h b/ydb/core/viewer/json_storage.h index b4ca833e5b..1c3531edd9 100644 --- a/ydb/core/viewer/json_storage.h +++ b/ydb/core/viewer/json_storage.h @@ -315,18 +315,15 @@ public: continue; } for (TString groupId : poolInfo.Groups) { - ++totalGroups; if (!CheckGroupFilters(groupId, poolName)) { continue; } - ++foundGroups; TGroupRow row; row.PoolName = poolName; row.GroupId = groupId; row.Kind = poolInfo.Kind; - bool degraded = false; auto ib = BSGroupIndex.find(groupId); if (ib != BSGroupIndex.end()) { row.Erasure = ib->second.GetErasureSpecies(); @@ -334,10 +331,11 @@ public: for (auto iv = vDiskIds.begin(); iv != vDiskIds.end(); ++iv) { const NKikimrBlobStorage::TVDiskID& vDiskId = *iv; auto ie = VDisksIndex.find(vDiskId); + bool degraded = false; if (ie != VDisksIndex.end()) { ui32 nodeId = ie->second.GetNodeId(); ui32 pDiskId = ie->second.GetPDiskId(); - degraded |= ie->second.GetReplicated() || ie->second.GetVDiskState() != NKikimrWhiteboard::EVDiskState::OK; + degraded |= !ie->second.GetReplicated() || ie->second.GetVDiskState() != NKikimrWhiteboard::EVDiskState::OK; row.Used += ie->second.GetAllocatedSize(); row.Limit += ie->second.GetAllocatedSize() + ie->second.GetAvailableSize(); row.Read += ie->second.GetReadThroughput(); @@ -350,13 +348,13 @@ public: row.Limit += ip->second.GetAvailableSize(); } } - } + } + if (degraded) { + row.Degraded++; + } } } - if (degraded) { - row.Degraded++; - } row.Usage = row.Limit == 0 ? 100 : (float)row.Used / row.Limit; if (!UsageBuckets.empty() && !BinarySearch(UsageBuckets.begin(), UsageBuckets.end(), (ui32)(row.Usage * 100) / UsagePace)) { continue; |