Skip to content

Commit bd147a9

Browse files
authored
Fix PDisk distconf metadata storage (#7175)
1 parent 96140d5 commit bd147a9

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

ydb/core/blobstorage/nodewarden/distconf_invoke.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ namespace NKikimr::NStorage {
144144
case TQuery::kReassignStateStorageNode:
145145
return ReassignStateStorageNode(record.GetReassignStateStorageNode());
146146

147+
case TQuery::kAdvanceGeneration:
148+
return AdvanceGeneration();
149+
147150
case TQuery::REQUEST_NOT_SET:
148151
return FinishWithError(TResult::ERROR, "Request field not set");
149152
}
@@ -598,6 +601,14 @@ namespace NKikimr::NStorage {
598601
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
599602
// Configuration proposition
600603

604+
void AdvanceGeneration() {
605+
if (RunCommonChecks()) {
606+
NKikimrBlobStorage::TStorageConfig config = *Self->StorageConfig;
607+
config.SetGeneration(config.GetGeneration() + 1);
608+
StartProposition(&config);
609+
}
610+
}
611+
601612
void StartProposition(NKikimrBlobStorage::TStorageConfig *config) {
602613
config->MutablePrevConfig()->CopyFrom(*Self->StorageConfig);
603614
config->MutablePrevConfig()->ClearPrevConfig();

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl_metadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ namespace NKikimr::NPDisk {
103103
<< " ChunkIdx# " << key.ChunkIdx
104104
<< " OffsetInSectors# " << key.OffsetInSectors);
105105
PDisk->BlockDevice->PwriteAsync(buffer.data(), buffer.size(), writeOffset, this, {}, nullptr);
106-
WriteQueue.pop_front();
107106
}
108107

109108
void Exec(TActorSystem *actorSystem) override {
110109
LOG_DEBUG_S(*actorSystem, NKikimrServices::BS_PDISK, "PDiskId# " << PDisk->PDiskId
111110
<< " TCompletionWriteMetadata::Exec"
112111
<< " Result# " << Result);
112+
Y_ABORT_UNLESS(!WriteQueue.empty());
113+
WriteQueue.pop_front();
113114
if (Result != EIoResult::Ok) {
114115
PDisk->InputRequest(PDisk->ReqCreator.CreateFromArgs<TWriteMetadataResult>(false, Sender));
115116
} else if (WriteQueue.empty()) {

ydb/core/protos/blobstorage_distributed_config.proto

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,17 @@ message TEvNodeConfigInvokeOnRoot {
181181
bool SchemeBoard = 5;
182182
}
183183

184+
message TAdvanceGeneration
185+
{}
186+
184187
oneof Request {
185188
TUpdateConfig UpdateConfig = 1;
186189
TQueryConfig QueryConfig = 2;
187190
TReassignGroupDisk ReassignGroupDisk = 3;
188191
TStaticVDiskSlain StaticVDiskSlain = 4;
189192
TDropDonor DropDonor = 5;
190193
TReassignStateStorageNode ReassignStateStorageNode = 6;
194+
TAdvanceGeneration AdvanceGeneration = 7;
191195
}
192196
}
193197

@@ -205,37 +209,19 @@ message TEvNodeConfigInvokeOnRootResult {
205209
uint32 NodeId = 2;
206210
}
207211

208-
message TUpdateConfig {
209-
}
210-
211212
message TQueryConfig {
212213
TStorageConfig Config = 1;
213214
TStorageConfig CurrentProposedStorageConfig = 2;
214215
}
215216

216-
message TReassignGroupDisk {
217-
}
218-
219-
message TStaticVDiskSlain {
220-
}
221-
222-
message TDropDonor {
223-
}
224-
225-
message TReassignStateStorageNode {
226-
}
227-
228217
EStatus Status = 1;
229218
optional string ErrorReason = 2;
230219
TScepter Scepter = 3;
231220

221+
reserved 4, 6, 7, 8, 9;
222+
232223
oneof Response {
233-
TUpdateConfig UpdateConfig = 4;
234224
TQueryConfig QueryConfig = 5;
235-
TReassignGroupDisk ReassignGroupDisk = 6;
236-
TStaticVDiskSlain StaticVDiskSlain = 7;
237-
TDropDonor DropDonor = 8;
238-
TReassignStateStorageNode ReassignStateStorageNode = 9;
239225
}
240226
}
241227

0 commit comments

Comments
 (0)