Skip to content

Commit 654938c

Browse files
authored
Fix deferred PDisk start logic with distconf (#13082)
1 parent fa346a5 commit 654938c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ namespace NKikimr::NStorage {
137137
void TNodeWarden::StartLocalPDisk(const NKikimrBlobStorage::TNodeWardenServiceSet::TPDisk& pdisk, bool temporary) {
138138
const TString& path = pdisk.GetPath();
139139
if (const auto it = PDiskByPath.find(path); it != PDiskByPath.end()) {
140+
Y_ABORT_UNLESS(!temporary);
140141
const auto jt = LocalPDisks.find(it->second.RunningPDiskId);
141142
Y_ABORT_UNLESS(jt != LocalPDisks.end());
142143
TPDiskRecord& record = jt->second;
143144
if (record.Temporary) { // this is temporary PDisk spinning, have to wait for it to finish
144-
Y_ABORT_UNLESS(!temporary);
145145
PDisksWaitingToStart.insert(pdisk.GetPDiskID());
146146
it->second.Pending = pdisk;
147147
} else { // incorrect configuration: we are trying to start two different PDisks with the same path
@@ -220,14 +220,10 @@ namespace NKikimr::NStorage {
220220
const TActorId actorId = MakeBlobStoragePDiskID(LocalNodeId, pdiskId);
221221
TActivationContext::Send(new IEventHandle(TEvents::TSystem::Poison, 0, actorId, {}, nullptr, 0));
222222
Send(WhiteboardId, new NNodeWhiteboard::TEvWhiteboard::TEvPDiskStateDelete(pdiskId));
223-
if (const auto jt = PDiskByPath.find(it->second.Record.GetPath()); jt != PDiskByPath.end() &&
224-
jt->second.RunningPDiskId == it->first) {
225-
pending = std::move(jt->second.Pending);
226-
PDiskByPath.erase(jt);
227-
PDisksWaitingToStart.erase(pending->GetPDiskID());
228-
} else {
229-
Y_DEBUG_ABORT("missing entry in PDiskByPath");
230-
}
223+
const auto jt = PDiskByPath.find(it->second.Record.GetPath());
224+
Y_ABORT_UNLESS(jt != PDiskByPath.end() && jt->second.RunningPDiskId == it->first);
225+
pending = std::move(jt->second.Pending);
226+
PDiskByPath.erase(jt);
231227
LocalPDisks.erase(it);
232228
PDiskRestartInFlight.erase(pdiskId);
233229

@@ -239,6 +235,7 @@ namespace NKikimr::NStorage {
239235
}
240236

241237
if (pending) {
238+
PDisksWaitingToStart.erase(pending->GetPDiskID());
242239
StartLocalPDisk(*pending, false);
243240

244241
// start VDisks over this one waiting for their turn

0 commit comments

Comments
 (0)