Skip to content

Commit

Permalink
Fix PDisk distconf metadata storage (#7175)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvru authored Jul 29, 2024
1 parent 96140d5 commit bd147a9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
11 changes: 11 additions & 0 deletions ydb/core/blobstorage/nodewarden/distconf_invoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ namespace NKikimr::NStorage {
case TQuery::kReassignStateStorageNode:
return ReassignStateStorageNode(record.GetReassignStateStorageNode());

case TQuery::kAdvanceGeneration:
return AdvanceGeneration();

case TQuery::REQUEST_NOT_SET:
return FinishWithError(TResult::ERROR, "Request field not set");
}
Expand Down Expand Up @@ -598,6 +601,14 @@ namespace NKikimr::NStorage {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Configuration proposition

void AdvanceGeneration() {
if (RunCommonChecks()) {
NKikimrBlobStorage::TStorageConfig config = *Self->StorageConfig;
config.SetGeneration(config.GetGeneration() + 1);
StartProposition(&config);
}
}

void StartProposition(NKikimrBlobStorage::TStorageConfig *config) {
config->MutablePrevConfig()->CopyFrom(*Self->StorageConfig);
config->MutablePrevConfig()->ClearPrevConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ namespace NKikimr::NPDisk {
<< " ChunkIdx# " << key.ChunkIdx
<< " OffsetInSectors# " << key.OffsetInSectors);
PDisk->BlockDevice->PwriteAsync(buffer.data(), buffer.size(), writeOffset, this, {}, nullptr);
WriteQueue.pop_front();
}

void Exec(TActorSystem *actorSystem) override {
LOG_DEBUG_S(*actorSystem, NKikimrServices::BS_PDISK, "PDiskId# " << PDisk->PDiskId
<< " TCompletionWriteMetadata::Exec"
<< " Result# " << Result);
Y_ABORT_UNLESS(!WriteQueue.empty());
WriteQueue.pop_front();
if (Result != EIoResult::Ok) {
PDisk->InputRequest(PDisk->ReqCreator.CreateFromArgs<TWriteMetadataResult>(false, Sender));
} else if (WriteQueue.empty()) {
Expand Down
26 changes: 6 additions & 20 deletions ydb/core/protos/blobstorage_distributed_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ message TEvNodeConfigInvokeOnRoot {
bool SchemeBoard = 5;
}

message TAdvanceGeneration
{}

oneof Request {
TUpdateConfig UpdateConfig = 1;
TQueryConfig QueryConfig = 2;
TReassignGroupDisk ReassignGroupDisk = 3;
TStaticVDiskSlain StaticVDiskSlain = 4;
TDropDonor DropDonor = 5;
TReassignStateStorageNode ReassignStateStorageNode = 6;
TAdvanceGeneration AdvanceGeneration = 7;
}
}

Expand All @@ -205,37 +209,19 @@ message TEvNodeConfigInvokeOnRootResult {
uint32 NodeId = 2;
}

message TUpdateConfig {
}

message TQueryConfig {
TStorageConfig Config = 1;
TStorageConfig CurrentProposedStorageConfig = 2;
}

message TReassignGroupDisk {
}

message TStaticVDiskSlain {
}

message TDropDonor {
}

message TReassignStateStorageNode {
}

EStatus Status = 1;
optional string ErrorReason = 2;
TScepter Scepter = 3;

reserved 4, 6, 7, 8, 9;

oneof Response {
TUpdateConfig UpdateConfig = 4;
TQueryConfig QueryConfig = 5;
TReassignGroupDisk ReassignGroupDisk = 6;
TStaticVDiskSlain StaticVDiskSlain = 7;
TDropDonor DropDonor = 8;
TReassignStateStorageNode ReassignStateStorageNode = 9;
}
}

Expand Down

0 comments on commit bd147a9

Please sign in to comment.