@@ -251,6 +251,7 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
251
251
struct TGroupState {
252
252
TString ErasureSpecies;
253
253
std::vector<const NKikimrSysView::TVSlotEntry*> VSlots;
254
+ ui32 Generation;
254
255
};
255
256
256
257
struct TSelfCheckResult {
@@ -1276,12 +1277,17 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
1276
1277
for (const auto & group : Groups->GetEntries ()) {
1277
1278
auto groupId = group.GetKey ().GetGroupId ();
1278
1279
auto poolId = group.GetInfo ().GetStoragePoolId ();
1279
- GroupState[groupId].ErasureSpecies = group.GetInfo ().GetErasureSpeciesV2 ();
1280
+ auto & groupState = GroupState[groupId];
1281
+ groupState.ErasureSpecies = group.GetInfo ().GetErasureSpeciesV2 ();
1282
+ groupState.Generation = group.GetInfo ().GetGeneration ();
1280
1283
StoragePoolState[poolId].Groups .emplace (groupId);
1281
1284
}
1282
1285
for (const auto & vSlot : VSlots->GetEntries ()) {
1283
1286
auto vSlotId = GetVSlotId (vSlot.GetKey ());
1284
- GroupState[vSlot.GetInfo ().GetGroupId ()].VSlots .push_back (&vSlot);
1287
+ auto groupStateIt = GroupState.find (vSlot.GetInfo ().GetGroupId ());
1288
+ if (groupStateIt != GroupState.end () && vSlot.GetInfo ().GetGroupGeneration () == groupStateIt->second .Generation ) {
1289
+ groupStateIt->second .VSlots .push_back (&vSlot);
1290
+ }
1285
1291
}
1286
1292
for (const auto & pool : StoragePools->GetEntries ()) { // there is no specific pool for static group here
1287
1293
ui64 poolId = pool.GetKey ().GetStoragePoolId ();
@@ -1782,6 +1788,13 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
1782
1788
1783
1789
storageVDiskStatus.set_id (GetVSlotId (vSlot->GetKey ()));
1784
1790
1791
+ if (!vSlot->GetInfo ().HasStatusV2 ()) {
1792
+ // this should mean that BSC recently restarted and does not have accurate data yet - we should not report to avoid false positives
1793
+ context.ReportStatus (Ydb::Monitoring::StatusFlag::GREEN);
1794
+ storageVDiskStatus.set_overall (context.GetOverallStatus ());
1795
+ return ;
1796
+ }
1797
+
1785
1798
const auto *descriptor = NKikimrBlobStorage::EVDiskStatus_descriptor ();
1786
1799
auto status = descriptor->FindValueByName (vSlot->GetInfo ().GetStatusV2 ());
1787
1800
if (!status) { // this case is not expected because becouse bsc assignes status according EVDiskStatus enum
@@ -1801,16 +1814,12 @@ class TSelfCheckRequest : public TActorBootstrapped<TSelfCheckRequest> {
1801
1814
storageVDiskStatus.set_overall (context.GetOverallStatus ());
1802
1815
return ;
1803
1816
}
1804
- case NKikimrBlobStorage::INIT_PENDING: { // initialization in process
1805
- context.ReportStatus (Ydb::Monitoring::StatusFlag::YELLOW, TStringBuilder () << " VDisk is being initialized" , ETags::VDiskState);
1806
- storageVDiskStatus.set_overall (context.GetOverallStatus ());
1807
- return ;
1808
- }
1809
1817
case NKikimrBlobStorage::REPLICATING: { // the disk accepts queries, but not all the data was replicated
1810
1818
context.ReportStatus (Ydb::Monitoring::StatusFlag::BLUE, TStringBuilder () << " Replication in progress" , ETags::VDiskState);
1811
1819
storageVDiskStatus.set_overall (context.GetOverallStatus ());
1812
1820
return ;
1813
1821
}
1822
+ case NKikimrBlobStorage::INIT_PENDING:
1814
1823
case NKikimrBlobStorage::READY: { // the disk is fully operational and does not affect group fault tolerance
1815
1824
context.ReportStatus (Ydb::Monitoring::StatusFlag::GREEN);
1816
1825
}
0 commit comments