diff options
author | yuryalekseev <yuryalekseev@yandex-team.com> | 2023-02-02 17:01:12 +0300 |
---|---|---|
committer | yuryalekseev <yuryalekseev@yandex-team.com> | 2023-02-02 17:01:12 +0300 |
commit | cc87dda0b50405f851e1ad4a069822969d7d1eea (patch) | |
tree | 1b99938c827e2aa74c899c748ed31ae0ce4eb35b | |
parent | fed15f08e95162b9d4734c949bbd291f85d6a247 (diff) | |
download | ydb-cc87dda0b50405f851e1ad4a069822969d7d1eea.tar.gz |
Improve some error messages.
-rw-r--r-- | ydb/core/mind/bscontroller/cmds_drive_status.cpp | 12 | ||||
-rw-r--r-- | ydb/core/mind/bscontroller/register_node.cpp | 5 |
2 files changed, 8 insertions, 9 deletions
diff --git a/ydb/core/mind/bscontroller/cmds_drive_status.cpp b/ydb/core/mind/bscontroller/cmds_drive_status.cpp index be9b6b6cb52..629c465ab34 100644 --- a/ydb/core/mind/bscontroller/cmds_drive_status.cpp +++ b/ydb/core/mind/bscontroller/cmds_drive_status.cpp @@ -100,25 +100,25 @@ namespace NKikimr::NBsController { auto driveInfo = DrivesSerials.Find(serial); if (driveInfo && driveInfo->LifeStage != NKikimrBlobStorage::TDriveLifeStage::REMOVED) { - throw TExAlready() << "Device with such serial already exists in BSC database in lifeStage" << driveInfo->LifeStage; + throw TExAlready() << "Device with such serial already exists in BSC database in lifeStage " << driveInfo->LifeStage; } auto it = NodeIdByDiskSerialNumber.find(serial); if (it == NodeIdByDiskSerialNumber.end()) { - throw TExError() << "Couldn't find node id for disk with serial number: " << serial; + throw TExError() << "Couldn't find node id for disk with serial number" << TErrorParams::DiskSerialNumber(serial); } auto nodeId = it->second; const auto& nodes = Nodes.Get(); auto nodeIt = nodes.find(nodeId); if (nodeIt == nodes.end()) { - throw TExError() << "Couldn't find node with node id: " << nodeId << " for disk with serial number: " << serial; + throw TExError() << "Couldn't find node by node id" << TErrorParams::NodeId(nodeId) << " for disk with serial number" << TErrorParams::DiskSerialNumber(serial); } const auto& nodeInfo = nodeIt->second; auto driveIt = nodeInfo.KnownDrives.find(serial); if (driveIt == nodeInfo.KnownDrives.end()) { - throw TExError() << "Couldn't find disk on node: " << nodeId << " by serial number: " << serial; + throw TExError() << "Couldn't find disk on node" << TErrorParams::NodeId(nodeId) << " by serial number" << TErrorParams::DiskSerialNumber(serial); } // delete REMOVED entry, if any, but keep its GUID @@ -153,11 +153,11 @@ namespace NKikimr::NBsController { auto driveInfo = DrivesSerials.Find(serial); if (!driveInfo) { - throw TExError() << "Couldn't find disk with serial number: " << serial; + throw TExError() << "Couldn't find disk with serial number" << TErrorParams::DiskSerialNumber(serial); } if (driveInfo->LifeStage == NKikimrBlobStorage::TDriveLifeStage::REMOVED) { - throw TExError() << "Disk with serial number: " << serial << " has already been removed"; + throw TExError() << "Disk with serial number" << TErrorParams::DiskSerialNumber(serial) << " has already been removed"; } auto driveInfoMutable = DrivesSerials.FindForUpdate(serial); diff --git a/ydb/core/mind/bscontroller/register_node.cpp b/ydb/core/mind/bscontroller/register_node.cpp index 633d3fc5bb3..4605780d379 100644 --- a/ydb/core/mind/bscontroller/register_node.cpp +++ b/ydb/core/mind/bscontroller/register_node.cpp @@ -59,7 +59,6 @@ class TBlobStorageController::TTxUpdateNodeDrives if (pdiskInfo.ExpectedSerial != serial) { // the disk on the node with the same label (path) as pdisk has a different serial number TStringStream log; - auto prio = NLog::PRI_ERROR; if (Self->SerialManagementStage == NKikimrBlobStorage::TSerialManagementStage::CHECK_SERIAL) { // don't update ExpectedSerial so that the corresponding PDisk wouldn't be able to start next time @@ -71,7 +70,7 @@ class TBlobStorageController::TTxUpdateNodeDrives db.Table<T>().Key(key).Update<T::ExpectedSerial>(serial); } - STLOG(prio, BS_CONTROLLER, BSCTXRN06, log.Str(), (PDiskId, pdiskId), (Path, pdiskInfo.Path), + STLOG(NLog::PRI_ERROR, BS_CONTROLLER, BSCTXRN06, log.Str(), (PDiskId, pdiskId), (Path, pdiskInfo.Path), (OldSerial, pdiskInfo.ExpectedSerial), (NewSerial, serial)); } } @@ -196,7 +195,7 @@ public: UpdateNodeDrivesRecord.SetNodeId(nodeId); for (const auto& data : record.GetDrivesData()) { - *UpdateNodeDrivesRecord.AddDrivesData() = data; + UpdateNodeDrivesRecord.AddDrivesData()->CopyFrom(data); } Self->OnRegisterNode(request->Recipient, nodeId); |