@@ -124,16 +124,17 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
124124 TVSlotReadyTimestampQ::iterator VSlotReadyTimestampIter;
125125
126126 public:
127- NKikimrBlobStorage::EVDiskStatus Status = NKikimrBlobStorage::EVDiskStatus::ERROR;
127+ std::optional<NKikimrBlobStorage::EVDiskStatus> VDiskStatus;
128+ NHPTimer::STime VDiskStatusTimestamp = GetCycleCountFast();
128129 bool IsReady = false ;
129130 bool OnlyPhantomsRemain = false ;
130131
131132 public:
132133 void SetStatus (NKikimrBlobStorage::EVDiskStatus status, TMonotonic now, TInstant instant, bool onlyPhantomsRemain) {
133- if (status != Status ) {
134+ if (status != VDiskStatus ) {
134135 if (status == NKikimrBlobStorage::EVDiskStatus::REPLICATING) { // became "replicating"
135136 LastGotReplicating = instant;
136- } else if (Status == NKikimrBlobStorage::EVDiskStatus::REPLICATING) { // was "replicating"
137+ } else if (VDiskStatus == NKikimrBlobStorage::EVDiskStatus::REPLICATING) { // was "replicating"
137138 Y_DEBUG_ABORT_UNLESS (LastGotReplicating != TInstant::Zero ());
138139 ReplicationTime += instant - LastGotReplicating;
139140 LastGotReplicating = {};
@@ -145,7 +146,7 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
145146 LastSeenReady = instant;
146147 }
147148
148- Status = status;
149+ VDiskStatus = status;
149150 IsReady = false ;
150151 if (status == NKikimrBlobStorage::EVDiskStatus::READY) {
151152 PutInVSlotReadyTimestampQ (now);
@@ -159,6 +160,10 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
159160 }
160161 }
161162
163+ NKikimrBlobStorage::EVDiskStatus GetStatus () const {
164+ return VDiskStatus.value_or (NKikimrBlobStorage::EVDiskStatus::ERROR);
165+ }
166+
162167 void PutInVSlotReadyTimestampQ (TMonotonic now) {
163168 const TMonotonic readyAfter = now + ReadyStablePeriod; // vdisk will be treated as READY one shortly, but not now
164169 Y_ABORT_UNLESS (VSlotReadyTimestampIter == TVSlotReadyTimestampQ::iterator ());
@@ -291,15 +296,16 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
291296
292297 TString GetStatusString () const {
293298 TStringStream s;
294- s << NKikimrBlobStorage::EVDiskStatus_Name (Status);
295- if (Status == NKikimrBlobStorage::REPLICATING && OnlyPhantomsRemain) {
299+ const auto status = GetStatus ();
300+ s << NKikimrBlobStorage::EVDiskStatus_Name (status);
301+ if (status == NKikimrBlobStorage::REPLICATING && OnlyPhantomsRemain) {
296302 s << " /p" ;
297303 }
298304 return s.Str ();
299305 }
300306
301307 bool IsOperational () const {
302- return Status >= NKikimrBlobStorage::REPLICATING;
308+ return GetStatus () >= NKikimrBlobStorage::REPLICATING;
303309 }
304310
305311 void OnCommit ();
@@ -2276,7 +2282,7 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
22762282 histo.IncrementFor (passed.Seconds ());
22772283
22782284 TDuration timeBeingReplicating = slot->ReplicationTime ;
2279- if (slot->Status == NKikimrBlobStorage::EVDiskStatus::REPLICATING) {
2285+ if (slot->GetStatus () == NKikimrBlobStorage::EVDiskStatus::REPLICATING) {
22802286 timeBeingReplicating += now - slot->LastGotReplicating ;
22812287 }
22822288
@@ -2301,7 +2307,8 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
23012307 const NKikimrBlobStorage::TVDiskKind::EVDiskKind VDiskKind;
23022308
23032309 std::optional<NKikimrBlobStorage::TVDiskMetrics> VDiskMetrics;
2304- NKikimrBlobStorage::EVDiskStatus VDiskStatus = NKikimrBlobStorage::EVDiskStatus::ERROR;
2310+ std::optional<NKikimrBlobStorage::EVDiskStatus> VDiskStatus;
2311+ NHPTimer::STime VDiskStatusTimestamp = GetCycleCountFast();
23052312 TMonotonic ReadySince = TMonotonic::Max(); // when IsReady becomes true for this disk; Max() in non-READY state
23062313
23072314 TStaticVSlotInfo (const NKikimrBlobStorage::TNodeWardenServiceSet::TVDisk& vdisk,
@@ -2315,6 +2322,7 @@ class TBlobStorageController : public TActor<TBlobStorageController>, public TTa
23152322 TStaticVSlotInfo& item = it->second ;
23162323 VDiskMetrics = std::move (item.VDiskMetrics );
23172324 VDiskStatus = item.VDiskStatus ;
2325+ VDiskStatusTimestamp = item.VDiskStatusTimestamp ;
23182326 ReadySince = item.ReadySince ;
23192327 }
23202328 }
0 commit comments