Skip to content

Commit 1035a63

Browse files
authored
Merge 596e02f into ebdab07
2 parents ebdab07 + 596e02f commit 1035a63

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

ydb/core/cms/sentinel.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ class TSentinel: public TActorBootstrapped<TSentinel> {
11151115
}
11161116

11171117
auto onPDiskStatusChanged = [&](const TPDiskID& id, TPDiskInfo& info) {
1118+
info.LastStatusChangeFailed = false;
11181119
info.StatusChangeFailed = false;
11191120
info.PrevStatus = info.ActualStatus;
11201121
info.ActualStatus = info.GetStatus();
@@ -1128,21 +1129,22 @@ class TSentinel: public TActorBootstrapped<TSentinel> {
11281129
(*Counters->PDisksChanged)++;
11291130
};
11301131

1131-
if (!response.GetSuccess() || !response.StatusSize() || !response.GetStatus(0).GetSuccess()) {
1132-
Y_ABORT_UNLESS(SentinelState->ChangeRequests.size() == response.StatusSize());
1132+
if (!response.GetSuccess() || !response.StatusSize()) {
1133+
for (auto& [key, req] : SentinelState->ChangeRequests) {
1134+
req->LastStatusChangeFailed = false;
1135+
req->StatusChangeFailed = true;
1136+
req->StatusChangeAttempt = SentinelState->StatusChangeAttempt;
1137+
}
1138+
1139+
Y_ABORT_UNLESS(SentinelState->ChangeRequests.size() <= response.StatusSize());
11331140
auto it = SentinelState->ChangeRequests.begin();
11341141
for (const auto& status : response.GetStatus()) {
11351142
if (!status.GetSuccess()) {
1143+
it->second->LastStatusChangeFailed = true;
11361144
LOG_E("Unsuccesful response from BSC"
11371145
<< ": error# " << status.GetErrorDescription());
1138-
1139-
it->second->StatusChangeFailed = true;
1140-
it->second->StatusChangeAttempt = SentinelState->StatusChangeAttempt;
1141-
++it;
1142-
} else {
1143-
onPDiskStatusChanged(it->first, *(it->second));
1144-
it = SentinelState->ChangeRequests.erase(it);
11451146
}
1147+
++it;
11461148
}
11471149

11481150
MaybeRetry();

ydb/core/cms/sentinel_impl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ struct TPDiskInfo
8787
EPDiskStatus PrevStatus = EPDiskStatus::ACTIVE;
8888
TInstant LastStatusChange;
8989
bool StatusChangeFailed = false;
90+
// means that this pdisk status change last time was the reason of whole request failure
91+
bool LastStatusChangeFailed = false;
9092
ui32 StatusChangeAttempt = 0;
9193
ui32 PrevStatusChangeAttempt = 0;
9294
EIgnoreReason IgnoreReason = NKikimrCms::TPDiskInfo::NOT_IGNORED;

0 commit comments

Comments
 (0)