aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuryalekseev <yuryalekseev@yandex-team.com>2023-02-17 21:35:37 +0300
committeryuryalekseev <yuryalekseev@yandex-team.com>2023-02-17 21:35:37 +0300
commita0032e21df987d6107944f82a079a56c1ed25d04 (patch)
tree62bc05835e3c6f769bd2a9e041ca92f49912cbd5
parent4e37755251073f79d5ed88db613403a3fb215e09 (diff)
downloadydb-a0032e21df987d6107944f82a079a56c1ed25d04.tar.gz
Add Guid to dstool device list.
-rw-r--r--ydb/apps/dstool/lib/dstool_cmd_device_list.py3
-rw-r--r--ydb/core/mind/bscontroller/cmds_storage_pool.cpp3
-rw-r--r--ydb/core/mind/bscontroller/config_fit_pdisks.cpp3
-rw-r--r--ydb/core/protos/blobstorage_config.proto3
4 files changed, 10 insertions, 2 deletions
diff --git a/ydb/apps/dstool/lib/dstool_cmd_device_list.py b/ydb/apps/dstool/lib/dstool_cmd_device_list.py
index 63549bfb05..ea682d3f48 100644
--- a/ydb/apps/dstool/lib/dstool_cmd_device_list.py
+++ b/ydb/apps/dstool/lib/dstool_cmd_device_list.py
@@ -21,6 +21,7 @@ def do(args):
'StorageStatus',
'NodeId:PDiskId',
'NodeId',
+ 'Guid',
'BoxId',
]
visible_columns = [
@@ -30,6 +31,7 @@ def do(args):
'Type',
'StorageStatus',
'NodeId:PDiskId',
+ 'Guid',
]
table_output = table.TableOutput(
@@ -47,6 +49,7 @@ def do(args):
row['Path'] = device.Path
row['Type'] = kikimr_bsconfig.EPDiskType.Name(device.Type)
row['BoxId'] = device.BoxId
+ row['Guid'] = device.Guid if device.Guid > 0 else 'NULL'
if usedByPDisk:
row['NodeId:PDiskId'] = '[%u:%u]' % (device.NodeId, device.PDiskId)
diff --git a/ydb/core/mind/bscontroller/cmds_storage_pool.cpp b/ydb/core/mind/bscontroller/cmds_storage_pool.cpp
index 5b04662fce..2438db453c 100644
--- a/ydb/core/mind/bscontroller/cmds_storage_pool.cpp
+++ b/ydb/core/mind/bscontroller/cmds_storage_pool.cpp
@@ -463,6 +463,9 @@ namespace NKikimr::NBsController {
if (driveInfo.Path) {
device->SetPath(driveInfo.Path.GetRef());
}
+ if (driveInfo.Guid) {
+ device->SetGuid(driveInfo.Guid.GetRef());
+ }
device->SetLifeStage(driveInfo.LifeStage);
device->SetType(driveInfo.PDiskType);
});
diff --git a/ydb/core/mind/bscontroller/config_fit_pdisks.cpp b/ydb/core/mind/bscontroller/config_fit_pdisks.cpp
index 298c82860c..20fe4de904 100644
--- a/ydb/core/mind/bscontroller/config_fit_pdisks.cpp
+++ b/ydb/core/mind/bscontroller/config_fit_pdisks.cpp
@@ -349,9 +349,10 @@ namespace NKikimr {
NKikimrBlobStorage::EDecommitStatus::DECOMMIT_NONE,
disk.Serial, disk.LastSeenSerial, disk.LastSeenPath, staticSlotUsage);
- // Set PDiskId in DrivesSerials
+ // Set PDiskId and Guid in DrivesSerials
if (auto info = state.DrivesSerials.FindForUpdate(disk.Serial)) {
info->PDiskId = pdiskId.PDiskId;
+ info->Guid = guid;
}
STLOG(PRI_NOTICE, BS_CONTROLLER, BSCFP02, "Create new pdisk", (PDiskId, pdiskId), (Path, disk.Path));
diff --git a/ydb/core/protos/blobstorage_config.proto b/ydb/core/protos/blobstorage_config.proto
index fc1a2f1d7f..40d5b9f9e9 100644
--- a/ydb/core/protos/blobstorage_config.proto
+++ b/ydb/core/protos/blobstorage_config.proto
@@ -646,7 +646,8 @@ message TBaseConfig {
uint32 PDiskId = 4;
string Path = 5;
EPDiskType Type = 6;
- TDriveLifeStage.E LifeStage = 7;
+ uint64 Guid = 7;
+ TDriveLifeStage.E LifeStage = 8;
}
repeated TPDisk PDisk = 1;