diff options
author | yuryalekseev <yuryalekseev@yandex-team.com> | 2023-02-08 17:54:08 +0300 |
---|---|---|
committer | yuryalekseev <yuryalekseev@yandex-team.com> | 2023-02-08 17:54:08 +0300 |
commit | 945d8203a53262c4091a566f075f660d51c715c0 (patch) | |
tree | 492992932d0d90e8cc41389f53ca5538ca90841d | |
parent | 9d9b0f8aa31ebf4ed8483deab6ea0b67ce59abcb (diff) | |
download | ydb-945d8203a53262c4091a566f075f660d51c715c0.tar.gz |
Save PDiskType and check for PDiskConfig properly.
-rw-r--r-- | ydb/core/mind/bscontroller/cmds_drive_status.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ydb/core/mind/bscontroller/cmds_drive_status.cpp b/ydb/core/mind/bscontroller/cmds_drive_status.cpp index 7c32168085..bf9e65db79 100644 --- a/ydb/core/mind/bscontroller/cmds_drive_status.cpp +++ b/ydb/core/mind/bscontroller/cmds_drive_status.cpp @@ -131,12 +131,16 @@ namespace NKikimr::NBsController { if (guid) { driveInfoMutable->Guid = *guid; } - driveInfoMutable->Kind = cmd.GetKind(); - driveInfoMutable->PDiskType = cmd.GetPDiskType(); + if (cmd.GetPDiskType() != NKikimrBlobStorage::UNKNOWN_TYPE) { + driveInfoMutable->PDiskType = cmd.GetPDiskType(); + } else { + driveInfoMutable->PDiskType = PDiskTypeToPDiskType(driveIt->second.DeviceType); + } TString config; - auto success = cmd.GetPDiskConfig().SerializeToString(&config); - Y_VERIFY(success); + if (!cmd.GetPDiskConfig().SerializeToString(&config)) { + throw TExError() << "Couldn't serialize PDiskConfig for disk with serial number" << TErrorParams::DiskSerialNumber(serial); + } driveInfoMutable->PDiskConfig = config; driveInfoMutable->LifeStage = NKikimrBlobStorage::TDriveLifeStage::ADDED; driveInfoMutable->NodeId = nodeId; |