diff options
author | Cthulhu <the_ancient_one@aol.com> | 2022-06-10 03:18:02 +0300 |
---|---|---|
committer | Cthulhu <the_ancient_one@aol.com> | 2022-06-10 03:18:02 +0300 |
commit | e734b2961b749f9daa0575c71ba854a77a4d2544 (patch) | |
tree | 358376560596b5c58284f7deb437e0293acd6f65 | |
parent | 7f76c51b6990d71c93d2af4e9c748a3d150ddbf3 (diff) | |
download | ydb-e734b2961b749f9daa0575c71ba854a77a4d2544.tar.gz |
Fix pdisk_io includes, KIKIMR-15048
ref:bca9f22871d68f236610c95aa74da79c0a5e9945
69 files changed, 306 insertions, 251 deletions
diff --git a/ydb/core/base/blobstorage.cpp b/ydb/core/base/blobstorage.cpp index 60bef7f4dff..8ce42d7ea93 100644 --- a/ydb/core/base/blobstorage.cpp +++ b/ydb/core/base/blobstorage.cpp @@ -2,31 +2,31 @@ namespace NKikimr { -NKikimrBlobStorage::EPDiskType PDiskTypeToPDiskType(const TPDiskCategory::EDeviceType type) { +NKikimrBlobStorage::EPDiskType PDiskTypeToPDiskType(const NPDisk::EDeviceType type) { switch (type) { - case TPDiskCategory::DEVICE_TYPE_ROT: + case NPDisk::DEVICE_TYPE_ROT: return NKikimrBlobStorage::EPDiskType::ROT; - case TPDiskCategory::DEVICE_TYPE_SSD: + case NPDisk::DEVICE_TYPE_SSD: return NKikimrBlobStorage::EPDiskType::SSD; - case TPDiskCategory::DEVICE_TYPE_NVME: + case NPDisk::DEVICE_TYPE_NVME: return NKikimrBlobStorage::EPDiskType::NVME; - case TPDiskCategory::DEVICE_TYPE_UNKNOWN: + case NPDisk::DEVICE_TYPE_UNKNOWN: return NKikimrBlobStorage::EPDiskType::UNKNOWN_TYPE; default: Y_FAIL("Device type is unknown; type# %" PRIu64, (ui64)type); } } -TPDiskCategory::EDeviceType PDiskTypeToPDiskType(const NKikimrBlobStorage::EPDiskType type) { +NPDisk::EDeviceType PDiskTypeToPDiskType(const NKikimrBlobStorage::EPDiskType type) { switch (type) { case NKikimrBlobStorage::EPDiskType::ROT: - return TPDiskCategory::DEVICE_TYPE_ROT; + return NPDisk::DEVICE_TYPE_ROT; case NKikimrBlobStorage::EPDiskType::SSD: - return TPDiskCategory::DEVICE_TYPE_SSD; + return NPDisk::DEVICE_TYPE_SSD; case NKikimrBlobStorage::EPDiskType::NVME: - return TPDiskCategory::DEVICE_TYPE_NVME; + return NPDisk::DEVICE_TYPE_NVME; case NKikimrBlobStorage::EPDiskType::UNKNOWN_TYPE: - return TPDiskCategory::DEVICE_TYPE_UNKNOWN; + return NPDisk::DEVICE_TYPE_UNKNOWN; default: Y_FAIL("Device type is unknown; type# %" PRIu64, (ui64)type); } diff --git a/ydb/core/base/blobstorage.h b/ydb/core/base/blobstorage.h index 03b2cc2fc6d..58011ce1bf4 100644 --- a/ydb/core/base/blobstorage.h +++ b/ydb/core/base/blobstorage.h @@ -84,9 +84,9 @@ struct TStorageStatusFlags { } }; -NKikimrBlobStorage::EPDiskType PDiskTypeToPDiskType(const TPDiskCategory::EDeviceType type); +NKikimrBlobStorage::EPDiskType PDiskTypeToPDiskType(const NPDisk::EDeviceType type); -TPDiskCategory::EDeviceType PDiskTypeToPDiskType(const NKikimrBlobStorage::EPDiskType type); +NPDisk::EDeviceType PDiskTypeToPDiskType(const NKikimrBlobStorage::EPDiskType type); enum class EGroupConfigurationType : ui32 { Static = 0, diff --git a/ydb/core/base/blobstorage_pdisk_category.h b/ydb/core/base/blobstorage_pdisk_category.h index 8c25b4dc254..7002fefa5e7 100644 --- a/ydb/core/base/blobstorage_pdisk_category.h +++ b/ydb/core/base/blobstorage_pdisk_category.h @@ -1,8 +1,8 @@ #pragma once +#include <ydb/library/pdisk_io/device_type.h> #include <util/generic/string.h> #include <util/stream/str.h> -#include <util/string/printf.h> #include <util/system/types.h> namespace NKikimr { @@ -25,36 +25,6 @@ class TPDiskCategory { // NVME -> IsSolidState# 1, TypeExt# 2 public: - enum EDeviceType : ui8 { - DEVICE_TYPE_ROT = 0, - DEVICE_TYPE_SSD = 1, - DEVICE_TYPE_NVME = 2, - DEVICE_TYPE_UNKNOWN = 255, - }; - - static TPDiskCategory::EDeviceType DeviceTypeFromStr(const TString &typeName) { - if (typeName == "ROT" || typeName == "DEVICE_TYPE_ROT") { - return DEVICE_TYPE_ROT; - } else if (typeName == "SSD" || typeName == "DEVICE_TYPE_SSD") { - return DEVICE_TYPE_SSD; - } else if (typeName == "NVME" || typeName == "DEVICE_TYPE_NVME") { - return DEVICE_TYPE_NVME; - } - return DEVICE_TYPE_UNKNOWN; - } - - static TString DeviceTypeStr(const TPDiskCategory::EDeviceType type, bool isShort) { - switch(type) { - case DEVICE_TYPE_ROT: - return isShort ? "ROT" : "DEVICE_TYPE_ROT"; - case DEVICE_TYPE_SSD: - return isShort ? "SSD" : "DEVICE_TYPE_SSD"; - case DEVICE_TYPE_NVME: - return isShort ? "NVME" : "DEVICE_TYPE_NVME"; - default: - return Sprintf("DEVICE_TYPE_UNKNOWN(%" PRIu64 ")", (ui64)type); - } - } TPDiskCategory() = default; @@ -62,13 +32,13 @@ public: Raw.X = raw; } - TPDiskCategory(EDeviceType type, ui64 kind) { + TPDiskCategory(NPDisk::EDeviceType type, ui64 kind) { Raw.N.TypeExt = 0; - if (type == DEVICE_TYPE_NVME) { + if (type == NPDisk::DEVICE_TYPE_NVME) { Raw.N.TypeExt = type; Y_VERIFY(Raw.N.TypeExt == type, "type# %" PRIu64 " is out of range!", (ui64)type); } - Raw.N.IsSolidState = (type == DEVICE_TYPE_SSD || type == DEVICE_TYPE_NVME); + Raw.N.IsSolidState = (type == NPDisk::DEVICE_TYPE_SSD || type == NPDisk::DEVICE_TYPE_NVME); Raw.N.Kind = kind; Y_VERIFY(Raw.N.Kind == kind, "kind# %" PRIu64 " is out of range!", (ui64)kind); } @@ -82,26 +52,26 @@ public: } bool IsSolidState() const { - return Raw.N.IsSolidState || Raw.N.TypeExt == DEVICE_TYPE_SSD || Raw.N.TypeExt == DEVICE_TYPE_NVME; + return Raw.N.IsSolidState || Raw.N.TypeExt == NPDisk::DEVICE_TYPE_SSD || Raw.N.TypeExt == NPDisk::DEVICE_TYPE_NVME; } - EDeviceType Type() const { + NPDisk::EDeviceType Type() const { if (Raw.N.TypeExt == 0) { if (Raw.N.IsSolidState) { - return DEVICE_TYPE_SSD; + return NPDisk::DEVICE_TYPE_SSD; } else { - return DEVICE_TYPE_ROT; + return NPDisk::DEVICE_TYPE_ROT; } } - return static_cast<EDeviceType>(Raw.N.TypeExt); + return static_cast<NPDisk::EDeviceType>(Raw.N.TypeExt); } TString TypeStrLong() const { - return DeviceTypeStr(Type(), false); + return NPDisk::DeviceTypeStr(Type(), false); } TString TypeStrShort() const { - return DeviceTypeStr(Type(), true); + return NPDisk::DeviceTypeStr(Type(), true); } ui64 Kind() const { @@ -110,7 +80,7 @@ public: TString ToString() const { TStringStream str; - str << "{Type# " << DeviceTypeStr(Type(), false); + str << "{Type# " << NPDisk::DeviceTypeStr(Type(), false); str << " Kind# " << Raw.N.Kind; str << "}"; return str.Str(); diff --git a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp index af14a13f2d0..c42a483e393 100644 --- a/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp +++ b/ydb/core/blobstorage/backpressure/queue_backpressure_client_ut.cpp @@ -194,7 +194,7 @@ public: PDiskId, PDiskGuid, 1, - TPDiskCategory::DEVICE_TYPE_ROT, + NPDisk::DEVICE_TYPE_ROT, 0, NKikimrBlobStorage::TVDiskKind::Default, 2, diff --git a/ydb/core/blobstorage/base/blobstorage_events.h b/ydb/core/blobstorage/base/blobstorage_events.h index ef170a085d8..f2f6a6df620 100644 --- a/ydb/core/blobstorage/base/blobstorage_events.h +++ b/ydb/core/blobstorage/base/blobstorage_events.h @@ -5,8 +5,8 @@ #include <ydb/core/base/blobstorage.h> #include <ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_defs.h> -#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.h> #include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h> +#include <ydb/core/blobstorage/pdisk/drivedata_serializer.h> namespace NKikimr { @@ -46,7 +46,7 @@ namespace NKikimr { Record.AddGroupGenerations(generation); } for (const auto& data : drivesData) { - data.ToProto(Record.AddDrivesData()); + DriveDataToDriveData(data, Record.AddDrivesData()); } } @@ -69,7 +69,7 @@ namespace NKikimr { TEvControllerUpdateNodeDrives(ui32 nodeId, const TVector<NPDisk::TDriveData>& drivesData) { Record.SetNodeId(nodeId); for (const auto& data : drivesData) { - data.ToProto(Record.AddDrivesData()); + DriveDataToDriveData(data, Record.AddDrivesData()); } } diff --git a/ydb/core/blobstorage/base/common_latency_hist_bounds.h b/ydb/core/blobstorage/base/common_latency_hist_bounds.h index 1f44e119197..25fd986a75a 100644 --- a/ydb/core/blobstorage/base/common_latency_hist_bounds.h +++ b/ydb/core/blobstorage/base/common_latency_hist_bounds.h @@ -7,20 +7,20 @@ namespace NKikimr { -static inline NMonitoring::TBucketBounds GetCommonLatencyHistBounds(TPDiskCategory::EDeviceType type) { +static inline NMonitoring::TBucketBounds GetCommonLatencyHistBounds(NPDisk::EDeviceType type) { NMonitoring::TBucketBounds bounds = { 8, 16, 32, 64, 128, 256, 512, // ms 1'024, 4'096, // s 65'536 // minutes }; switch (type) { - case TPDiskCategory::DEVICE_TYPE_UNKNOWN: + case NPDisk::DEVICE_TYPE_UNKNOWN: // Use default break; - case TPDiskCategory::DEVICE_TYPE_ROT: + case NPDisk::DEVICE_TYPE_ROT: // Use default break; - case TPDiskCategory::DEVICE_TYPE_SSD: + case NPDisk::DEVICE_TYPE_SSD: bounds = { 0.5, // us 1, 2, 8, 32, 128, 512, // ms @@ -28,7 +28,7 @@ static inline NMonitoring::TBucketBounds GetCommonLatencyHistBounds(TPDiskCatego 65'536 // minutes }; break; - case TPDiskCategory::DEVICE_TYPE_NVME: + case NPDisk::DEVICE_TYPE_NVME: bounds = { 0.25, 0.5, // us 1, 2, 4, 8, 32, 128, // ms diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_mon.h b/ydb/core/blobstorage/dsproxy/dsproxy_mon.h index 941bea6664a..def0fc399b8 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_mon.h +++ b/ydb/core/blobstorage/dsproxy/dsproxy_mon.h @@ -299,7 +299,7 @@ public: PutThroughput->Count(size); } - void CountPutPesponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, ui32 size, + void CountPutPesponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, ui32 size, TDuration duration) { const ui32 durationMs = duration.MilliSeconds(); PutResponseTime.Increment(durationMs); @@ -324,7 +324,7 @@ public: NodeMon->CountPutPesponseTime(type, cls, size, duration); } - void CountGetResponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, ui32 size, + void CountGetResponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, ui32 size, TDuration duration) { *EventGetResBytes += size; GetResponseTime.Increment(duration.MilliSeconds()); @@ -351,7 +351,7 @@ public: NodeMon->RangeResponseTime.Increment(duration.MilliSeconds()); } - void CountPatchResponseTime(TPDiskCategory::EDeviceType type, TDuration duration) { + void CountPatchResponseTime(NPDisk::EDeviceType type, TDuration duration) { PatchResponseTime.Increment(duration.MilliSeconds()); NodeMon->CountPatchResponseTime(type, duration); } diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.cpp b/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.cpp index b12c5fcf895..06e30bed2c2 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.cpp +++ b/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.cpp @@ -40,10 +40,10 @@ TDsProxyNodeMon::TDsProxyNodeMon(TIntrusivePtr<NMonitoring::TDynamicCounters> &c IsCountersPresentedForIdx.fill(false); if (initForAllDeviceTypes) { - CheckNodeMonCountersForDeviceType(TPDiskCategory::DEVICE_TYPE_ROT); - CheckNodeMonCountersForDeviceType(TPDiskCategory::DEVICE_TYPE_SSD); - CheckNodeMonCountersForDeviceType(TPDiskCategory::DEVICE_TYPE_NVME); - CheckNodeMonCountersForDeviceType(TPDiskCategory::DEVICE_TYPE_UNKNOWN); + CheckNodeMonCountersForDeviceType(NPDisk::DEVICE_TYPE_ROT); + CheckNodeMonCountersForDeviceType(NPDisk::DEVICE_TYPE_SSD); + CheckNodeMonCountersForDeviceType(NPDisk::DEVICE_TYPE_NVME); + CheckNodeMonCountersForDeviceType(NPDisk::DEVICE_TYPE_UNKNOWN); } // restart counters @@ -88,17 +88,17 @@ TDsProxyNodeMon::TDsProxyNodeMon(TIntrusivePtr<NMonitoring::TDynamicCounters> &c } } -ui32 IdxForType(TPDiskCategory::EDeviceType type) { +ui32 IdxForType(NPDisk::EDeviceType type) { switch (type) { - case TPDiskCategory::DEVICE_TYPE_ROT: return 0; - case TPDiskCategory::DEVICE_TYPE_SSD: return 1; - case TPDiskCategory::DEVICE_TYPE_NVME: return 2; - case TPDiskCategory::DEVICE_TYPE_UNKNOWN: return 3; + case NPDisk::DEVICE_TYPE_ROT: return 0; + case NPDisk::DEVICE_TYPE_SSD: return 1; + case NPDisk::DEVICE_TYPE_NVME: return 2; + case NPDisk::DEVICE_TYPE_UNKNOWN: return 3; } return 3; } -void TDsProxyNodeMon::CountPutPesponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, +void TDsProxyNodeMon::CountPutPesponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, ui32 size, TDuration duration) { const ui32 durationMs = duration.MilliSeconds(); const double durationMsFloat = duration.MicroSeconds() / 1000.0; @@ -135,7 +135,7 @@ void TDsProxyNodeMon::CountPutPesponseTime(TPDiskCategory::EDeviceType type, NKi } } -void TDsProxyNodeMon::CountGetResponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, +void TDsProxyNodeMon::CountGetResponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, ui32 size, TDuration duration) { const ui32 durationMs = duration.MilliSeconds(); const double durationMsFloat = duration.MicroSeconds() / 1000.0; @@ -174,7 +174,7 @@ void TDsProxyNodeMon::CountGetResponseTime(TPDiskCategory::EDeviceType type, NKi } } -void TDsProxyNodeMon::CountPatchResponseTime(TPDiskCategory::EDeviceType type, TDuration duration) { +void TDsProxyNodeMon::CountPatchResponseTime(NPDisk::EDeviceType type, TDuration duration) { const ui32 durationMs = duration.MilliSeconds(); const double durationMsFloat = duration.MicroSeconds() / 1000.0; PatchResponseTime.Increment(durationMs); @@ -183,13 +183,13 @@ void TDsProxyNodeMon::CountPatchResponseTime(TPDiskCategory::EDeviceType type, T PatchResponseTimeHist[idx]->Collect(durationMsFloat); } -void TDsProxyNodeMon::CheckNodeMonCountersForDeviceType(TPDiskCategory::EDeviceType type) { +void TDsProxyNodeMon::CheckNodeMonCountersForDeviceType(NPDisk::EDeviceType type) { const ui32 idx = IdxForType(type); if (!IsCountersPresentedForIdx[idx]) { IsCountersPresentedForIdx[idx] = true; TIntrusivePtr<NMonitoring::TDynamicCounters> subGroup = - Group->GetSubgroup("media", to_lower(TPDiskCategory::DeviceTypeStr(type, true))); + Group->GetSubgroup("media", to_lower(NPDisk::DeviceTypeStr(type, true))); auto getNamedHisto = [&subGroup, &type] (const TString& name) { auto buckets = NMonitoring::ExplicitHistogram(GetCommonLatencyHistBounds(type)); diff --git a/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h b/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h index 956e470e37c..7eb0338badc 100644 --- a/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h +++ b/ydb/core/blobstorage/dsproxy/dsproxy_nodemon.h @@ -95,14 +95,14 @@ struct TDsProxyNodeMon : public TThrRefBase { NMonitoring::TDynamicCounters::TCounterPtr ConnectedMinus3more; TDsProxyNodeMon(TIntrusivePtr<NMonitoring::TDynamicCounters> &counters, bool initForAllDeviceTypes); - void CountPutPesponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, ui32 size, + void CountPutPesponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EPutHandleClass cls, ui32 size, TDuration duration); - void CountGetResponseTime(TPDiskCategory::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, ui32 size, + void CountGetResponseTime(NPDisk::EDeviceType type, NKikimrBlobStorage::EGetHandleClass cls, ui32 size, TDuration duration); - void CountPatchResponseTime(TPDiskCategory::EDeviceType type, TDuration duration); + void CountPatchResponseTime(NPDisk::EDeviceType type, TDuration duration); // Called only from NodeWarder - void CheckNodeMonCountersForDeviceType(TPDiskCategory::EDeviceType type); + void CheckNodeMonCountersForDeviceType(NPDisk::EDeviceType type); void IncNumUnconnected(ui32 num) { switch (num) { diff --git a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp index 914173e95f8..11fcaeacfde 100644 --- a/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp +++ b/ydb/core/blobstorage/dsproxy/ut_fat/dsproxy_ut.cpp @@ -130,7 +130,7 @@ struct TTestArgs { ui32 DrivesPerFailDomain = 0; TIntrusivePtr<ITestParametrs> Parametrs = nullptr; bool EnablePutBatching = DefaultEnablePutBatching; - TPDiskCategory::EDeviceType DeviceType = TPDiskCategory::DEVICE_TYPE_ROT; + NPDisk::EDeviceType DeviceType = NPDisk::DEVICE_TYPE_ROT; }; struct TTestEnvironment : public TThrRefBase { @@ -4046,7 +4046,7 @@ public: void TestBatchedPutRequestDoesNotContainAHugeBlob() { TTestArgs args{0, TBlobStorageGroupType::ErasureNone}; - args.DeviceType = TPDiskCategory::DEVICE_TYPE_NVME; + args.DeviceType = NPDisk::DEVICE_TYPE_NVME; TestBlobStorage<TTestBlobStorageProxyBatchedPutRequestDoesNotContainAHugeBlob>(nullptr, args); SectorMapByPath.clear(); } diff --git a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp index 7a7cb76ed6d..f0d696e82dd 100644 --- a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp +++ b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.cpp @@ -584,7 +584,7 @@ TBlobStorageGroupInfo::TBlobStorageGroupInfo(TBlobStorageGroupType gtype, ui32 n } TBlobStorageGroupInfo::TBlobStorageGroupInfo(std::shared_ptr<TTopology> topology, TDynamicInfo&& dyn, TString storagePoolName, - TMaybe<TKikimrScopeId> acceptedScope, TPDiskCategory::EDeviceType deviceType) + TMaybe<TKikimrScopeId> acceptedScope, NPDisk::EDeviceType deviceType) : GroupID(dyn.GroupId) , GroupGeneration(dyn.GroupGeneration) , Type(topology->GType) @@ -596,7 +596,7 @@ TBlobStorageGroupInfo::TBlobStorageGroupInfo(std::shared_ptr<TTopology> topology {} TBlobStorageGroupInfo::TBlobStorageGroupInfo(TTopology&& topology, TDynamicInfo&& dyn, TString storagePoolName, - TMaybe<TKikimrScopeId> acceptedScope, TPDiskCategory::EDeviceType deviceType) + TMaybe<TKikimrScopeId> acceptedScope, NPDisk::EDeviceType deviceType) : TBlobStorageGroupInfo(std::make_shared<TTopology>(std::move(topology)), std::move(dyn), std::move(storagePoolName), std::move(acceptedScope), deviceType) { @@ -651,7 +651,7 @@ TIntrusivePtr<TBlobStorageGroupInfo> TBlobStorageGroupInfo::Parse(const NKikimrB const auto& scope = group.GetAcceptedScope(); acceptedScope.ConstructInPlace(scope.GetX1(), scope.GetX2()); } - TPDiskCategory::EDeviceType commonDeviceType = TPDiskCategory::DEVICE_TYPE_UNKNOWN; + NPDisk::EDeviceType commonDeviceType = NPDisk::DEVICE_TYPE_UNKNOWN; if (group.HasDeviceType()) { commonDeviceType = PDiskTypeToPDiskType(group.GetDeviceType()); } diff --git a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h index 2b89538bc8b..a1390f0495b 100644 --- a/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h +++ b/ydb/core/blobstorage/groupinfo/blobstorage_groupinfo.h @@ -307,10 +307,10 @@ public: TCypherKey key = TCypherKey((const ui8*)"TestKey", 8)); TBlobStorageGroupInfo(std::shared_ptr<TTopology> topology, TDynamicInfo&& rti, TString storagePoolName, - TMaybe<TKikimrScopeId> acceptedScope, TPDiskCategory::EDeviceType deviceType); + TMaybe<TKikimrScopeId> acceptedScope, NPDisk::EDeviceType deviceType); TBlobStorageGroupInfo(TTopology&& topology, TDynamicInfo&& rti, TString storagePoolName, - TMaybe<TKikimrScopeId> acceptedScope = {}, TPDiskCategory::EDeviceType deviceType = TPDiskCategory::DEVICE_TYPE_UNKNOWN); + TMaybe<TKikimrScopeId> acceptedScope = {}, NPDisk::EDeviceType deviceType = NPDisk::DEVICE_TYPE_UNKNOWN); TBlobStorageGroupInfo(const TIntrusivePtr<TBlobStorageGroupInfo>& info, const TVDiskID& vdiskId, const TActorId& actorId); @@ -327,7 +327,7 @@ public: return StoragePoolName ? StoragePoolName : "static"; } - TPDiskCategory::EDeviceType GetDeviceType() const { + NPDisk::EDeviceType GetDeviceType() const { return DeviceType; } @@ -431,7 +431,7 @@ private: // access control TMaybe<TKikimrScopeId> AcceptedScope; TString StoragePoolName; - TPDiskCategory::EDeviceType DeviceType = TPDiskCategory::DEVICE_TYPE_UNKNOWN; + NPDisk::EDeviceType DeviceType = NPDisk::DEVICE_TYPE_UNKNOWN; }; // physical fail domain description diff --git a/ydb/core/blobstorage/nodewarden/node_warden_impl.cpp b/ydb/core/blobstorage/nodewarden/node_warden_impl.cpp index 1ac15a8b437..f681fb7beda 100644 --- a/ydb/core/blobstorage/nodewarden/node_warden_impl.cpp +++ b/ydb/core/blobstorage/nodewarden/node_warden_impl.cpp @@ -1,5 +1,6 @@ #include "node_warden_impl.h" +#include <ydb/core/blobstorage/pdisk/drivedata_serializer.h> #include <ydb/library/pdisk_io/file_params.h> using namespace NKikimr; @@ -12,7 +13,9 @@ TVector<NPDisk::TDriveData> TNodeWarden::ListLocalDrives() { TString raw = TFileInput(MockDevicesPath).ReadAll(); if (google::protobuf::TextFormat::ParseFromString(raw, &MockDevicesConfig)) { for (const auto& device : MockDevicesConfig.GetDevices()) { - drives.emplace_back(device); + NPDisk::TDriveData data; + DriveDataToDriveData(device, data); + drives.push_back(data); } } else { STLOG(PRI_WARN, BS_NODE, NW01, "Error parsing mock devices protobuf from file", (Path, MockDevicesPath)); diff --git a/ydb/core/blobstorage/nodewarden/node_warden_mon.cpp b/ydb/core/blobstorage/nodewarden/node_warden_mon.cpp index 79568dbe87b..691a15f2ee0 100644 --- a/ydb/core/blobstorage/nodewarden/node_warden_mon.cpp +++ b/ydb/core/blobstorage/nodewarden/node_warden_mon.cpp @@ -287,7 +287,7 @@ void TNodeWarden::RenderLocalDrives(IOutputStream& out) { TABLED() { out << data->Path; } TABLED() { out << data->SerialNumber.Quote(); } TABLED() { - out << TPDiskCategory::DeviceTypeStr(data->DeviceType, true); + out << NPDisk::DeviceTypeStr(data->DeviceType, true); out << (data->IsMock ? "(mock)" : ""); } } diff --git a/ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp b/ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp index 07adc41be7a..10e6069c9b5 100644 --- a/ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp +++ b/ydb/core/blobstorage/nodewarden/node_warden_pdisk.cpp @@ -1,17 +1,17 @@ #include "node_warden_impl.h" #include <ydb/core/blobstorage/crypto/default.h> -#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.h> #include <ydb/library/pdisk_io/file_params.h> +#include <ydb/library/pdisk_io/wcache.h> #include <util/string/split.h> namespace NKikimr::NStorage { - static const std::unordered_map<TPDiskCategory::EDeviceType, ui64> DefaultSpeedLimit{ - {TPDiskCategory::DEVICE_TYPE_ROT, 100000000}, - {TPDiskCategory::DEVICE_TYPE_SSD, 200000000}, - {TPDiskCategory::DEVICE_TYPE_NVME, 300000000}, + static const std::unordered_map<NPDisk::EDeviceType, ui64> DefaultSpeedLimit{ + {NPDisk::DEVICE_TYPE_ROT, 100000000}, + {NPDisk::DEVICE_TYPE_SSD, 200000000}, + {NPDisk::DEVICE_TYPE_NVME, 300000000}, }; TIntrusivePtr<TPDiskConfig> TNodeWarden::CreatePDiskConfig(const NKikimrBlobStorage::TNodeWardenServiceSet::TPDisk& pdisk) { diff --git a/ydb/core/blobstorage/nodewarden/node_warden_resource.cpp b/ydb/core/blobstorage/nodewarden/node_warden_resource.cpp index d8179b7af81..3498e2174c4 100644 --- a/ydb/core/blobstorage/nodewarden/node_warden_resource.cpp +++ b/ydb/core/blobstorage/nodewarden/node_warden_resource.cpp @@ -1,9 +1,9 @@ #include "node_warden_impl.h" #include <ydb/core/blobstorage/crypto/default.h> -#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.h> #include <ydb/library/pdisk_io/file_params.h> +#include <ydb/library/pdisk_io/wcache.h> #include <util/string/split.h> diff --git a/ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp b/ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp index 986770b1c57..8e6bc269865 100644 --- a/ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp +++ b/ydb/core/blobstorage/nodewarden/node_warden_vdisk.cpp @@ -71,7 +71,7 @@ namespace NKikimr::NStorage { Y_VERIFY_S(pdiskIt != LocalPDisks.end(), "PDiskId# " << vslotId.NodeId << ":" << vslotId.PDiskId << " not found"); auto& pdisk = pdiskIt->second; Y_VERIFY_S(pdisk.Record.GetPDiskGuid() == pdiskGuid, "PDiskId# " << vslotId.NodeId << ":" << vslotId.PDiskId << " PDiskGuid mismatch"); - const TPDiskCategory::EDeviceType deviceType = TPDiskCategory(pdisk.Record.GetPDiskCategory()).Type(); + const NPDisk::EDeviceType deviceType = TPDiskCategory(pdisk.Record.GetPDiskCategory()).Type(); const TActorId pdiskServiceId = MakeBlobStoragePDiskID(vslotId.NodeId, vslotId.PDiskId); const TActorId vdiskServiceId = MakeBlobStorageVDiskID(vslotId.NodeId, vslotId.PDiskId, vslotId.VDiskSlotId); diff --git a/ydb/core/blobstorage/pdisk/CMakeLists.txt b/ydb/core/blobstorage/pdisk/CMakeLists.txt index 808c4cd13b0..2ac16b5fcd2 100644 --- a/ydb/core/blobstorage/pdisk/CMakeLists.txt +++ b/ydb/core/blobstorage/pdisk/CMakeLists.txt @@ -42,7 +42,6 @@ target_sources(core-blobstorage-pdisk PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_completion_impl.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_delayed_cost_loop.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivemodel_db.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl_http.cpp @@ -58,11 +57,11 @@ target_sources(core-blobstorage-pdisk PRIVATE ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_atomicblockcounter.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_flightcontrol.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_signal_event.cpp - ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_writer.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_helpers.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_actions.cpp ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut_yard.cpp + ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/drivedata_serializer.cpp ) generate_enum_serilization(core-blobstorage-pdisk ${CMAKE_SOURCE_DIR}/ydb/core/blobstorage/pdisk/blobstorage_pdisk_state.h diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice.h index aa28b6297da..650b2e6fc53 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice.h @@ -2,13 +2,13 @@ #include "defs.h" #include "blobstorage_pdisk_completion.h" -#include "blobstorage_pdisk_drivedata.h" #include "blobstorage_pdisk_request_id.h" #include "blobstorage_pdisk_util_devicemode.h" #include <ydb/core/base/blobstorage.h> #include <ydb/core/control/immediate_control_board_wrapper.h> #include <ydb/library/pdisk_io/aio.h> +#include <ydb/library/pdisk_io/drivedata.h> #include <ydb/library/pdisk_io/sector_map.h> #include <ydb/library/wilson/wilson_event.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp index 34c20999b7b..a86f62bef17 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_async.cpp @@ -7,7 +7,6 @@ #include "blobstorage_pdisk_util_countedqueueoneone.h" #include "blobstorage_pdisk_util_flightcontrol.h" #include "blobstorage_pdisk_util_idlecounter.h" -#include "blobstorage_pdisk_util_wcache.h" #include <ydb/core/base/appdata.h> #include <ydb/core/blobstorage/base/wilson_events.h> @@ -17,6 +16,7 @@ #include <ydb/core/util/yverify_stream.h> #include <ydb/library/pdisk_io/aio.h> #include <ydb/library/pdisk_io/spdk_state.h> +#include <ydb/library/pdisk_io/wcache.h> #include <library/cpp/actors/core/log.h> #include <library/cpp/actors/util/thread.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h index a3d764aa7e1..5990a2ee874 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_config.h @@ -1,8 +1,6 @@ #pragma once #include "defs.h" -#include "blobstorage_pdisk_util_wcache.h" - #include <ydb/core/base/blobstorage.h> #include <ydb/core/base/compile_time_flags.h> #include <ydb/core/blobstorage/base/vdisk_priorities.h> @@ -10,8 +8,10 @@ #include <ydb/core/protos/blobstorage.pb.h> #include <ydb/core/protos/config.pb.h> +#include <ydb/library/pdisk_io/drivedata.h> #include <ydb/library/pdisk_io/file_params.h> #include <ydb/library/pdisk_io/sector_map.h> +#include <ydb/library/pdisk_io/wcache.h> namespace NKikimr { @@ -161,29 +161,29 @@ struct TPDiskConfig : public TThrRefBase { Initialize(); } - TPDiskCategory::EDeviceType RetrieveDeviceType() { + NPDisk::EDeviceType RetrieveDeviceType() { TStringStream outDetails; if (std::optional<NPDisk::TDriveData> data = NPDisk::GetDriveData(Path, &outDetails)) { return data->DeviceType; } else if (Path.Contains("nvme") || Path.Contains("NVME")) { - return TPDiskCategory::DEVICE_TYPE_NVME; + return NPDisk::DEVICE_TYPE_NVME; } else if (Path.Contains("ssd") || Path.Contains("SSD")) { - return TPDiskCategory::DEVICE_TYPE_SSD; + return NPDisk::DEVICE_TYPE_SSD; } else { return PDiskCategory.Type(); } } void Initialize() { - TPDiskCategory::EDeviceType deviceType = RetrieveDeviceType(); + NPDisk::EDeviceType deviceType = RetrieveDeviceType(); auto choose = [&] (ui64 nvme, ui64 ssd, ui64 hdd) { - if (deviceType == TPDiskCategory::DEVICE_TYPE_ROT) { + if (deviceType == NPDisk::DEVICE_TYPE_ROT) { return hdd; - } else if (deviceType == TPDiskCategory::DEVICE_TYPE_SSD) { + } else if (deviceType == NPDisk::DEVICE_TYPE_SSD) { return ssd; - } else if (deviceType == TPDiskCategory::DEVICE_TYPE_NVME) { + } else if (deviceType == NPDisk::DEVICE_TYPE_NVME) { return nvme; } else { return hdd; @@ -201,7 +201,7 @@ struct TPDiskConfig : public TThrRefBase { CostLimitNs = choose(500'000ull, 20'000'000ull, 50'000'000ull); UseSpdkNvmeDriver = Path.StartsWith("PCIe:"); - Y_VERIFY(!UseSpdkNvmeDriver || deviceType == TPDiskCategory::DEVICE_TYPE_NVME, + Y_VERIFY(!UseSpdkNvmeDriver || deviceType == NPDisk::DEVICE_TYPE_NVME, "SPDK NVMe driver can be used only with NVMe devices!"); } diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.cpp deleted file mode 100644 index 9a19772f593..00000000000 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "defs.h" - -#include "blobstorage_pdisk_drivedata.h" - -#include <ydb/core/base/blobstorage.h> -#include <ydb/core/protos/blobstorage.pb.h> - -namespace NKikimr { -namespace NPDisk { - -TDriveData::TDriveData(const NKikimrBlobStorage::TDriveData& p) - : Path(p.GetPath()) - , SerialNumber(p.GetSerialNumber()) - , FirmwareRevision(p.GetFirmwareRevision()) - , ModelNumber(p.GetModelNumber()) - , DeviceType(PDiskTypeToPDiskType(p.GetDeviceType())) - , Size(p.HasSize() ? p.GetSize() : 0) - , IsMock(p.HasIsMock() ? p.GetIsMock() : false) -{} - -TString TDriveData::ToString(bool isMultiline) const { - const char *x = isMultiline ? "\n" : ""; - TStringStream str; - str << "{Path# " << Path.Quote() << x - << " IsWriteCacheValid# " << IsWriteCacheValid << x - << " IsWriteCacheEnabled# " << IsWriteCacheEnabled << x - << " ModelNumber# " << ModelNumber.Quote() << x - << " SerialNumber# " << SerialNumber.Quote() << x - << " FirmwareRevision# " << FirmwareRevision.Quote() << x - << " DeviceType# " << TPDiskCategory::DeviceTypeStr(DeviceType, true) << x - << "}" << x; - return str.Str(); -} - -void TDriveData::ToProto(NKikimrBlobStorage::TDriveData *p) const { - p->SetPath(Path); - p->SetSerialNumber(SerialNumber); - p->SetFirmwareRevision(FirmwareRevision); - p->SetModelNumber(ModelNumber); - p->SetDeviceType(PDiskTypeToPDiskType(DeviceType)); - p->SetSize(Size); - p->SetIsMock(IsMock); -} - -bool operator==(const NPDisk::TDriveData& lhs, const NPDisk::TDriveData& rhs) { - NKikimrBlobStorage::TDriveData l_p; - lhs.ToProto(&l_p); - TString l_s; - Y_PROTOBUF_SUPPRESS_NODISCARD l_p.SerializeToString(&l_s); - NKikimrBlobStorage::TDriveData r_p; - rhs.ToProto(&r_p); - TString r_s; - Y_PROTOBUF_SUPPRESS_NODISCARD r_p.SerializeToString(&r_s); - return l_s == r_s; -} - -} // NPDisk -} // NKikimr diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.cpp index 3419eeda6f8..fd431f2fd97 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_driveestimator.cpp @@ -1,7 +1,7 @@ #include "blobstorage_pdisk_driveestimator.h" -#include "blobstorage_pdisk_util_wcache.h" #include <ydb/library/pdisk_io/aio.h> +#include <ydb/library/pdisk_io/wcache.h> #include <util/system/align.h> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.cpp index a514e261ab7..b67aca83327 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.cpp @@ -95,7 +95,7 @@ TPDiskMon::TPDiskMon(const TIntrusivePtr<NMonitoring::TDynamicCounters>& counter QueueRequests = QueueGroup->GetCounter("QueueRequests", true); QueueBytes = QueueGroup->GetCounter("QueueBytes", true); - auto deviceType = cfg ? cfg->PDiskCategory.Type() : TPDiskCategory::DEVICE_TYPE_UNKNOWN; + auto deviceType = cfg ? cfg->PDiskCategory.Type() : NPDisk::DEVICE_TYPE_UNKNOWN; // scheduler subgroup ForsetiCbsNotFound = SchedulerGroup->GetCounter("ForsetiCbsNotFound"); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.h b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.h index 38a0f73b7c8..7a1fc6fcd31 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.h +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_mon.h @@ -310,7 +310,7 @@ private: public: void Initialize(const TIntrusivePtr<NMonitoring::TDynamicCounters>& counters, - const TString &name, TPDiskCategory::EDeviceType deviceType) { + const TString &name, NPDisk::EDeviceType deviceType) { TString histName = name + "Ms"; // Histogram backets in milliseconds auto h = NMonitoring::ExplicitHistogram(GetCommonLatencyHistBounds(deviceType)); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp index 152deec9997..e6e279c4a59 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_tools.cpp @@ -57,7 +57,7 @@ void FormatPDisk(TString path, ui64 diskSizeBytes, ui32 sectorSizeBytes, ui32 us TActorSystemCreator creator; bool isBlockDevice = false; - TPDiskCategory::EDeviceType deviceType = TPDiskCategory::DEVICE_TYPE_ROT; + NPDisk::EDeviceType deviceType = NPDisk::DEVICE_TYPE_ROT; if (sectorMap) { if (diskSizeBytes) { sectorMap->ForceSize(diskSizeBytes); @@ -69,7 +69,7 @@ void FormatPDisk(TString path, ui64 diskSizeBytes, ui32 sectorSizeBytes, ui32 us } } else { if (path.StartsWith("PCIe:")) { - deviceType = TPDiskCategory::DEVICE_TYPE_NVME; + deviceType = NPDisk::DEVICE_TYPE_NVME; } if (diskSizeBytes == 0) { creator.GetActorSystem()->AppData<TAppData>()->IoContextFactory diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp index b49b5bd206f..05e059ffcfb 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_ut.cpp @@ -12,7 +12,7 @@ Y_UNIT_TEST_SUITE(TPDiskTest) { Y_UNIT_TEST(TestAbstractPDiskInterface) { TString path = "/tmp/asdqwe"; TIntrusivePtr<TPDiskConfig> cfg = new TPDiskConfig(path, 12345, 0xffffffffull, - TPDiskCategory(TPDiskCategory::DEVICE_TYPE_ROT, 0).GetRaw()); + TPDiskCategory(NPDisk::DEVICE_TYPE_ROT, 0).GetRaw()); const TIntrusivePtr<NMonitoring::TDynamicCounters> counters(new NMonitoring::TDynamicCounters); THolder<NPDisk::IPDisk> pDisk = MakeHolder<NPDisk::TPDisk>(cfg, counters); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_ut.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_ut.cpp index 97938cfcdc4..ab26072e166 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_ut.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_ut.cpp @@ -11,10 +11,10 @@ #include "blobstorage_pdisk_ut_defs.h" #include "blobstorage_pdisk_util_atomicblockcounter.h" #include "blobstorage_pdisk_util_sector.h" -#include "blobstorage_pdisk_util_wcache.h" #include <ydb/core/blobstorage/crypto/default.h> #include <ydb/library/pdisk_io/aio.h> +#include <ydb/library/pdisk_io/wcache.h> #include <library/cpp/testing/unittest/registar.h> #include <util/stream/null.h> diff --git a/ydb/core/blobstorage/pdisk/drivedata_serializer.cpp b/ydb/core/blobstorage/pdisk/drivedata_serializer.cpp new file mode 100644 index 00000000000..2649b25d90e --- /dev/null +++ b/ydb/core/blobstorage/pdisk/drivedata_serializer.cpp @@ -0,0 +1,33 @@ +#include "defs.h" + +#include "drivedata_serializer.h" +#include <ydb/library/pdisk_io/drivedata.h> + +#include <ydb/core/base/blobstorage.h> +#include <ydb/core/protos/blobstorage.pb.h> + +namespace NKikimr { +namespace NPDisk { + +void DriveDataToDriveData(const NKikimrBlobStorage::TDriveData& p, TDriveData& out_data) { + out_data.Path = p.GetPath(); + out_data.SerialNumber = p.GetSerialNumber(); + out_data.FirmwareRevision = p.GetFirmwareRevision(); + out_data.ModelNumber = p.GetModelNumber(); + out_data.DeviceType = PDiskTypeToPDiskType(p.GetDeviceType()); + out_data.Size = (p.HasSize() ? p.GetSize() : 0); + out_data.IsMock = (p.HasIsMock() ? p.GetIsMock() : false); +} + +void DriveDataToDriveData(const TDriveData& data, NKikimrBlobStorage::TDriveData *out_p) { + out_p->SetPath(data.Path); + out_p->SetSerialNumber(data.SerialNumber); + out_p->SetFirmwareRevision(data.FirmwareRevision); + out_p->SetModelNumber(data.ModelNumber); + out_p->SetDeviceType(PDiskTypeToPDiskType(data.DeviceType)); + out_p->SetSize(data.Size); + out_p->SetIsMock(data.IsMock); +} + +} // NPDisk +} // NKikimr diff --git a/ydb/core/blobstorage/pdisk/drivedata_serializer.h b/ydb/core/blobstorage/pdisk/drivedata_serializer.h new file mode 100644 index 00000000000..312610fa432 --- /dev/null +++ b/ydb/core/blobstorage/pdisk/drivedata_serializer.h @@ -0,0 +1,16 @@ +#pragma once + +namespace NKikimrBlobStorage { +class TDriveData; +} + +namespace NKikimr { +namespace NPDisk { + +struct TDriveData; + +void DriveDataToDriveData(const TDriveData& data, NKikimrBlobStorage::TDriveData *out_p); +void DriveDataToDriveData(const NKikimrBlobStorage::TDriveData& p, TDriveData& out_data); + +} // NPDisk +} // NKikimr diff --git a/ydb/core/blobstorage/storagepoolmon/storagepool_counters.h b/ydb/core/blobstorage/storagepoolmon/storagepool_counters.h index 9c4cdab62ff..9cf9dcc69ae 100644 --- a/ydb/core/blobstorage/storagepoolmon/storagepool_counters.h +++ b/ydb/core/blobstorage/storagepoolmon/storagepool_counters.h @@ -22,7 +22,7 @@ struct TRequestMonItem { NMonitoring::TDynamicCounters::TCounterPtr GeneratedSubrequestBytes; NMonitoring::THistogramPtr ResponseTime; - void Init(TIntrusivePtr<NMonitoring::TDynamicCounters> counters, TPDiskCategory::EDeviceType type) { + void Init(TIntrusivePtr<NMonitoring::TDynamicCounters> counters, NPDisk::EDeviceType type) { RequestBytes = counters->GetCounter("requestBytes", true); GeneratedSubrequests = counters->GetCounter("generatedSubrequests", true); GeneratedSubrequestBytes = counters->GetCounter("generatedSubrequestBytes", true); @@ -164,7 +164,7 @@ public: } TStoragePoolCounters(TIntrusivePtr<NMonitoring::TDynamicCounters> &counters, const TString &storagePoolName, - TPDiskCategory::EDeviceType type) { + NPDisk::EDeviceType type) { StoragePoolName = storagePoolName; TIntrusivePtr<NMonitoring::TDynamicCounters> poolGroup = counters->GetSubgroup("storagePool", storagePoolName); for (ui32 handleClass = 0; handleClass < (ui32)HcCount; ++handleClass) { @@ -198,7 +198,7 @@ public: }; TIntrusivePtr<TStoragePoolCounters> GetPoolCounters(const TString &storagePoolName, - TPDiskCategory::EDeviceType type = TPDiskCategory::DEVICE_TYPE_UNKNOWN) { + NPDisk::EDeviceType type = NPDisk::DEVICE_TYPE_UNKNOWN) { auto it = StoragePoolCounters.find(storagePoolName); if (it != StoragePoolCounters.end()) { return it->second; diff --git a/ydb/core/blobstorage/ut_group/main.cpp b/ydb/core/blobstorage/ut_group/main.cpp index 12b8ab51141..066e2735d9c 100644 --- a/ydb/core/blobstorage/ut_group/main.cpp +++ b/ydb/core/blobstorage/ut_group/main.cpp @@ -314,7 +314,7 @@ public: dynamic.ServiceIdForOrderNumber = Info->GetDynamicInfo().ServiceIdForOrderNumber; dynamic.ServiceIdForOrderNumber[topology.GetOrderNumber(disk.VDiskId)] = disk.VDiskActorId; Info = MakeIntrusive<TBlobStorageGroupInfo>(std::move(topology), std::move(dynamic), TString(), Nothing(), - TPDiskCategory::DEVICE_TYPE_SSD); + NPDisk::DEVICE_TYPE_SSD); StartVDisk(runtime, disk); @@ -368,7 +368,7 @@ private: for (ui32 nodeId = 1, i = 0; nodeId <= NodeCount; ++nodeId, ++i) { const ui32 pdiskId = 1; const ui64 pdiskGuid = TAppData::RandomProvider->GenRand64(); - const TPDiskCategory category(TPDiskCategory::DEVICE_TYPE_SSD, 0); + const TPDiskCategory category(NPDisk::DEVICE_TYPE_SSD, 0); const TActorId& actorId = runtime.Register(CreatePDiskMockActor(MakeIntrusive<TPDiskMockState>(nodeId, pdiskId, pdiskGuid, ui64(1000) << 30)), TActorId(), 0, std::nullopt, nodeId); const TActorId& serviceId = MakeBlobStoragePDiskID(nodeId, pdiskId); @@ -404,7 +404,7 @@ private: auto proxy = Counters->GetSubgroup("subsystem", "proxy"); TIntrusivePtr<TDsProxyNodeMon> mon = MakeIntrusive<TDsProxyNodeMon>(proxy, true); - StoragePoolCounters = MakeIntrusive<TStoragePoolCounters>(proxy, TString(), TPDiskCategory::DEVICE_TYPE_SSD); + StoragePoolCounters = MakeIntrusive<TStoragePoolCounters>(proxy, TString(), NPDisk::DEVICE_TYPE_SSD); std::unique_ptr<IActor> proxyActor{CreateBlobStorageGroupProxyConfigured(TIntrusivePtr(Info), false, mon, TIntrusivePtr(StoragePoolCounters), DefaultEnablePutBatching, DefaultEnableVPatch)}; const TActorId& actorId = runtime.Register(proxyActor.release(), TActorId(), 0, std::nullopt, 1); @@ -413,7 +413,7 @@ private: void StartVDisk(TTestActorSystem& runtime, TDiskRecord& disk) { TVDiskConfig::TBaseInfo baseInfo(disk.VDiskId, disk.PDiskActorId, disk.PDiskGuid, disk.PDiskId, - TPDiskCategory::DEVICE_TYPE_SSD, disk.VDiskSlotId, NKikimrBlobStorage::TVDiskKind::Default, ++Round, + NPDisk::DEVICE_TYPE_SSD, disk.VDiskSlotId, NKikimrBlobStorage::TVDiskKind::Default, ++Round, TString()); auto vdiskConfig = AllVDiskKinds->MakeVDiskConfig(baseInfo); vdiskConfig->EnableVDiskCooldownTimeout = true; diff --git a/ydb/core/blobstorage/ut_mirror3of4/main.cpp b/ydb/core/blobstorage/ut_mirror3of4/main.cpp index 071a2852ddd..9429913f388 100644 --- a/ydb/core/blobstorage/ut_mirror3of4/main.cpp +++ b/ydb/core/blobstorage/ut_mirror3of4/main.cpp @@ -264,7 +264,7 @@ private: pdiskActorId, pdisk.PDiskGuid, pdisk.PDiskId, - TPDiskCategory::DEVICE_TYPE_SSD, + NPDisk::DEVICE_TYPE_SSD, 0, NKikimrBlobStorage::TVDiskKind::Default, 2, // InitOwnerRound diff --git a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h index 17a25ef9fbe..2672d3a5155 100644 --- a/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h +++ b/ydb/core/blobstorage/ut_pdiskfit/lib/basic_test.h @@ -50,7 +50,7 @@ public: StateManager = stateManager; Counters = env->Counters; PDiskConfig = new TPDiskConfig(env->PDiskFilePath, env->PDiskGuid, 1, - TPDiskCategory(TPDiskCategory::DEVICE_TYPE_ROT, 0).GetRaw()); + TPDiskCategory(NPDisk::DEVICE_TYPE_ROT, 0).GetRaw()); PDiskConfig->GetDriveDataSwitch = NKikimrBlobStorage::TPDiskConfig::DoNotTouch; PDiskConfig->WriteCacheSwitch = NKikimrBlobStorage::TPDiskConfig::DoNotTouch; env->ActorSystem->Register(this); diff --git a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp index 9d4a4678abf..1950abff898 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/prepare.cpp @@ -153,7 +153,7 @@ void TAllPDisks::ActorSetupCmd(NActors::TActorSystemSetup *setup, ui32 node, TOnePDisk &inst = PDisks[i]; inst.PDiskActorID = MakeBlobStoragePDiskID(node, i); TIntrusivePtr<TPDiskConfig> pDiskConfig; - TPDiskCategory::EDeviceType deviceType = TPDiskCategory::DeviceTypeFromStr(Cfg.DeviceType); + NPDisk::EDeviceType deviceType = NPDisk::DeviceTypeFromStr(Cfg.DeviceType); pDiskConfig.Reset(new TPDiskConfig(inst.Filename, inst.PDiskGuid, inst.PDiskID, TPDiskCategory(deviceType, 0).GetRaw())); pDiskConfig->GetDriveDataSwitch = NKikimrBlobStorage::TPDiskConfig::DoNotTouch; @@ -244,7 +244,7 @@ bool TDefaultVDiskSetup::SetUp(TAllVDisks::TVDiskInstance &vdisk, TAllPDisks *pd vdisk.VDiskID = TVDiskID(0, 1, 0, d, j); NKikimr::TVDiskConfig::TBaseInfo baseInfo(vdisk.VDiskID, pdisk.PDiskActorID, pdisk.PDiskGuid, - pdisk.PDiskID, NKikimr::TPDiskCategory::DEVICE_TYPE_ROT, slotId, + pdisk.PDiskID, NKikimr::NPDisk::DEVICE_TYPE_ROT, slotId, NKikimrBlobStorage::TVDiskKind::Default, initOwnerRound, {}); vdisk.Cfg = MakeIntrusive<NKikimr::TVDiskConfig>(baseInfo); diff --git a/ydb/core/blobstorage/ut_vdisk/lib/test_huge.cpp b/ydb/core/blobstorage/ut_vdisk/lib/test_huge.cpp index 7364483b0c5..9940e6da358 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/test_huge.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/test_huge.cpp @@ -125,7 +125,7 @@ class THugeModuleRecoveryActor : public TActorBootstrapped<THugeModuleRecoveryAc auto &vDiskInstance = HmCtx->Conf->VDisks->Get(0); HmCtx->Config = vDiskInstance.Cfg; HmCtx->VCtx.Reset(new TVDiskContext(ctx.SelfID, HmCtx->Conf->GroupInfo->PickTopology(), HmCtx->Counters, - vDiskInstance.VDiskID, ctx.ExecutorThread.ActorSystem, TPDiskCategory::DEVICE_TYPE_UNKNOWN)); + vDiskInstance.VDiskID, ctx.ExecutorThread.ActorSystem, NPDisk::DEVICE_TYPE_UNKNOWN)); TVDiskID selfVDiskID = HmCtx->Conf->GroupInfo->GetVDiskId(HmCtx->VCtx->ShortSelfVDisk); ctx.Send(HmCtx->Config->BaseInfo.PDiskActorID, diff --git a/ydb/core/blobstorage/ut_vdisk/lib/test_repl.cpp b/ydb/core/blobstorage/ut_vdisk/lib/test_repl.cpp index ae4288ab25b..2baeac688c9 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/test_repl.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/test_repl.cpp @@ -199,7 +199,7 @@ private: TIntrusivePtr<NMonitoring::TDynamicCounters> counters = new NMonitoring::TDynamicCounters; auto groupInfo = TBlobStorageGroupInfo(TBlobStorageGroupType::ErasureMirror3, 2, 4); VCtx.Reset(new TVDiskContext(ctx.SelfID, groupInfo.PickTopology(), counters, VDiskInfo.VDiskID, - ctx.ExecutorThread.ActorSystem, TPDiskCategory::DEVICE_TYPE_UNKNOWN)); + ctx.ExecutorThread.ActorSystem, NPDisk::DEVICE_TYPE_UNKNOWN)); ReplCtx = std::make_shared<TReplCtx>( VCtx, diff --git a/ydb/core/blobstorage/ut_vdisk/lib/test_synclog.cpp b/ydb/core/blobstorage/ut_vdisk/lib/test_synclog.cpp index b5608c382d2..53810322f60 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/test_synclog.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/test_synclog.cpp @@ -166,7 +166,7 @@ class TSyncLogTestWriteActor : public TActorBootstrapped<TSyncLogTestWriteActor> auto &vDiskInstance = Conf->VDisks->Get(0); auto &groupInfo = Conf->GroupInfo; VCtx = MakeIntrusive<TVDiskContext>(ctx.SelfID, groupInfo->PickTopology(), counters, vDiskInstance.VDiskID, - ctx.ExecutorThread.ActorSystem, TPDiskCategory::DEVICE_TYPE_UNKNOWN); + ctx.ExecutorThread.ActorSystem, NPDisk::DEVICE_TYPE_UNKNOWN); VDiskConfig = vDiskInstance.Cfg; TestCtx->SelfVDiskId = groupInfo->GetVDiskId(VCtx->ShortSelfVDisk); diff --git a/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp b/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp index 0d68629c647..16b267a6222 100644 --- a/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp +++ b/ydb/core/blobstorage/ut_vdisk/lib/vdisk_mock.cpp @@ -37,7 +37,7 @@ public: void Bootstrap(const TActorContext& ctx) { VCtx.Reset(new TVDiskContext(ctx.SelfID, Top, new NMonitoring::TDynamicCounters, VDiskId, - ctx.ExecutorThread.ActorSystem, TPDiskCategory::DEVICE_TYPE_UNKNOWN)); + ctx.ExecutorThread.ActorSystem, NPDisk::DEVICE_TYPE_UNKNOWN)); Become(&TVDiskMockActor::StateFunc); } diff --git a/ydb/core/blobstorage/ut_vdisk2/env.h b/ydb/core/blobstorage/ut_vdisk2/env.h index 4d53effb997..d2c4397a39b 100644 --- a/ydb/core/blobstorage/ut_vdisk2/env.h +++ b/ydb/core/blobstorage/ut_vdisk2/env.h @@ -99,7 +99,7 @@ namespace NKikimr { // create vdisk config TVDiskConfig::TBaseInfo baseInfo(VDiskId, PDiskServiceId, PDiskGuid, PDiskId, - TPDiskCategory::DEVICE_TYPE_SSD, VSlotId, NKikimrBlobStorage::TVDiskKind::Default, 1, + NPDisk::DEVICE_TYPE_SSD, VSlotId, NKikimrBlobStorage::TVDiskKind::Default, 1, "static"); VDiskConfig = AllVDiskKinds->MakeVDiskConfig(baseInfo); diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_config.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_config.cpp index 312fb3961ff..47c169ad88a 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_config.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_config.cpp @@ -122,8 +122,8 @@ namespace NKikimr { void TVDiskConfig::SetupHugeBytes() { switch (BaseInfo.DeviceType) { - case TPDiskCategory::DEVICE_TYPE_SSD: - case TPDiskCategory::DEVICE_TYPE_NVME: + case NPDisk::DEVICE_TYPE_SSD: + case NPDisk::DEVICE_TYPE_NVME: MinHugeBlobInBytes = 64u << 10u; break; default: diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_config.h b/ydb/core/blobstorage/vdisk/common/vdisk_config.h index ff4bb4f0d61..efe272f3ddc 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_config.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_config.h @@ -22,7 +22,7 @@ namespace NKikimr { ui64 InitOwnerRound = 0; ui64 PDiskGuid = 0; ui32 PDiskId = 0; - TPDiskCategory::EDeviceType DeviceType = TPDiskCategory::DEVICE_TYPE_UNKNOWN; + NPDisk::EDeviceType DeviceType = NPDisk::DEVICE_TYPE_UNKNOWN; ui32 VDiskSlotId = 0; EKind Kind = NKikimrBlobStorage::TVDiskKind::Default; // name of the storage pool this VDisk belongs to @@ -45,7 +45,7 @@ namespace NKikimr { const TActorId &pDiskActorId, ui64 pDiskGuid, ui32 pdiskId, - TPDiskCategory::EDeviceType deviceType, + NPDisk::EDeviceType deviceType, ui32 vdiskSlotId, EKind kind, ui64 initOwnerRound, diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_config_ut.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_config_ut.cpp index 941df64a10b..02eecadb0ed 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_config_ut.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_config_ut.cpp @@ -15,7 +15,7 @@ namespace NKikimr { TVDiskConfig::TBaseInfo GetDefaultBaseInfo(NKikimrBlobStorage::TVDiskKind::EVDiskKind kind) { return TVDiskConfig::TBaseInfo(TVDiskID(), TActorId(), 0x1234, 0x5678, - TPDiskCategory::DEVICE_TYPE_ROT, 0x01, kind, 1, {}); + NPDisk::DEVICE_TYPE_ROT, 0x01, kind, 1, {}); } Y_UNIT_TEST(Basic) { diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_context.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_context.cpp index 0635f0ec9e8..00f0b778c41 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_context.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_context.cpp @@ -25,7 +25,7 @@ namespace NKikimr { const TIntrusivePtr<NMonitoring::TDynamicCounters>& vdiskCounters, const TVDiskID &selfVDisk, TActorSystem *as, // as can be nullptr for tests - TPDiskCategory::EDeviceType type, + NPDisk::EDeviceType type, bool donorMode, TReplQuoter::TPtr replPDiskReadQuoter, TReplQuoter::TPtr replPDiskWriteQuoter, diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_context.h b/ydb/core/blobstorage/vdisk/common/vdisk_context.h index 7bb7dfd6704..9d383fc15d0 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_context.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_context.h @@ -83,7 +83,7 @@ namespace NKikimr { const TIntrusivePtr<NMonitoring::TDynamicCounters>& vdiskCounters, const TVDiskID &selfVDisk, TActorSystem *as, // can be nullptr for tests - TPDiskCategory::EDeviceType type, + NPDisk::EDeviceType type, bool donorMode = false, TReplQuoter::TPtr replPDiskReadQuoter = nullptr, TReplQuoter::TPtr replPDiskWriteQuoter = nullptr, diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.cpp index 9fa79f17e2d..abe249a9298 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.cpp @@ -9,7 +9,7 @@ namespace NKikimr { const TIntrusivePtr<NMonitoring::TDynamicCounters>& counters, const TString &name, const TString &value, - TPDiskCategory::EDeviceType type) + NPDisk::EDeviceType type) { auto group = counters->GetSubgroup(name, value); ThroughputBytes = group->GetCounter("requestBytes", true); diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.h b/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.h index d0388fac73f..9ed0594e3b5 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_histogram_latency.h @@ -23,7 +23,7 @@ namespace NKikimr { TLtcHisto(const TIntrusivePtr<NMonitoring::TDynamicCounters>& counters, const TString &name, const TString &value, - TPDiskCategory::EDeviceType type); + NPDisk::EDeviceType type); // update histogram with with an operation with duration 'd' void Collect(TDuration d, ui64 size = 0); diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_histograms.cpp b/ydb/core/blobstorage/vdisk/common/vdisk_histograms.cpp index dc70cc2c0ce..8ef4f0c700d 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_histograms.cpp +++ b/ydb/core/blobstorage/vdisk/common/vdisk_histograms.cpp @@ -5,7 +5,7 @@ namespace NKikimr { THistograms::THistograms( const TIntrusivePtr<NMonitoring::TDynamicCounters>& counters, - TPDiskCategory::EDeviceType type) + NPDisk::EDeviceType type) { for (const auto& item : { std::make_pair(&VGetAsyncLatencyHistogram, "GetAsync" ), diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_histograms.h b/ydb/core/blobstorage/vdisk/common/vdisk_histograms.h index 9b83a65546b..5dc749481d4 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_histograms.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_histograms.h @@ -14,7 +14,7 @@ namespace NKikimr { public: THistograms( const TIntrusivePtr<NMonitoring::TDynamicCounters>& counters, - TPDiskCategory::EDeviceType type); + NPDisk::EDeviceType type); const NVDiskMon::TLtcHistoPtr &GetHistogram(NKikimrBlobStorage::EGetHandleClass handleClass) const; const NVDiskMon::TLtcHistoPtr &GetHistogram(NKikimrBlobStorage::EPutHandleClass handleClass) const; diff --git a/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhuge_ut.cpp b/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhuge_ut.cpp index ed64a07678e..451792bb26e 100644 --- a/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhuge_ut.cpp +++ b/ydb/core/blobstorage/vdisk/huge/blobstorage_hullhuge_ut.cpp @@ -28,7 +28,7 @@ namespace NKikimr { auto counters = MakeIntrusive<NMonitoring::TDynamicCounters>(); auto info = MakeIntrusive<TBlobStorageGroupInfo>(TBlobStorageGroupType::Erasure4Plus2Block); auto vctx = MakeIntrusive<TVDiskContext>(TActorId(), info->PickTopology(), counters, TVDiskID(0, 1, 0, 0, 0), - nullptr, TPDiskCategory::DEVICE_TYPE_UNKNOWN); + nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); std::unique_ptr<THullHugeKeeperPersState> state( new THullHugeKeeperPersState(vctx, chunkSize, appendBlockSize, minHugeBlobInBytes, milestoneHugeBlobInBytes, maxBlobInBytes, diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/hullds_ut.h b/ydb/core/blobstorage/vdisk/hulldb/base/hullds_ut.h index b0d875a060c..5a1367202d4 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/hullds_ut.h +++ b/ydb/core/blobstorage/vdisk/hulldb/base/hullds_ut.h @@ -13,7 +13,7 @@ namespace NKikimr { , CompWorthReadSize(compWorthReadSize) , GroupInfo(TBlobStorageGroupType::ErasureMirror3, 2, 4) , VCtx(new TVDiskContext(TActorId(), GroupInfo.PickTopology(), new NMonitoring::TDynamicCounters(), - TVDiskID(), nullptr, TPDiskCategory::DEVICE_TYPE_UNKNOWN)) + TVDiskID(), nullptr, NPDisk::DEVICE_TYPE_UNKNOWN)) , HullCtx( new THullCtx( VCtx, diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp index cacb1405938..30db44ff22a 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_hullreplwritesst_ut.cpp @@ -13,7 +13,7 @@ std::shared_ptr<TReplCtx> CreateReplCtx(TVector<TVDiskID>& vdisks, const TIntrus auto vdiskCfg = MakeIntrusive<TVDiskConfig>(baseInfo); auto counters = MakeIntrusive<NMonitoring::TDynamicCounters>(); auto vctx = MakeIntrusive<TVDiskContext>(TActorId(), info->PickTopology(), counters, TVDiskID(0, 1, 0, 0, 0), - nullptr, TPDiskCategory::DEVICE_TYPE_UNKNOWN); + nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); auto hugeBlobCtx = std::make_shared<THugeBlobCtx>(512u << 10u, nullptr); auto dsk = MakeIntrusive<TPDiskParams>(ui8(1), 1u, 128u << 20, 4096u, 0u, 1000000000u, 1000000000u, 65536u, 65536u, 65536u); auto pdiskCtx = std::make_shared<TPDiskCtx>(dsk, TActorId()); @@ -31,7 +31,7 @@ std::shared_ptr<TReplCtx> CreateReplCtx(TVector<TVDiskID>& vdisks, const TIntrus TVDiskContextPtr CreateVDiskContext(const TBlobStorageGroupInfo& info) { return MakeIntrusive<TVDiskContext>(TActorId(), info.PickTopology(), new NMonitoring::TDynamicCounters(), TVDiskID(), - nullptr, TPDiskCategory::DEVICE_TYPE_UNKNOWN); + nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); } TIntrusivePtr<THullCtx> CreateHullCtx(const TBlobStorageGroupInfo& info, ui32 chunkSize, ui32 compWorthReadSize) { diff --git a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp index 3ff7efb53e2..df26bf2c32d 100644 --- a/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp +++ b/ydb/core/blobstorage/vdisk/repl/blobstorage_replrecoverymachine_ut.cpp @@ -65,7 +65,7 @@ namespace NKikimr { auto vdiskCfg = MakeIntrusive<TVDiskConfig>(baseInfo); auto counters = MakeIntrusive<NMonitoring::TDynamicCounters>(); auto vctx = MakeIntrusive<TVDiskContext>(TActorId(), info->PickTopology(), counters, TVDiskID(0, 1, 0, 0, 0), - nullptr, TPDiskCategory::DEVICE_TYPE_UNKNOWN); + nullptr, NPDisk::DEVICE_TYPE_UNKNOWN); auto hugeBlobCtx = std::make_shared<THugeBlobCtx>(512u << 10u, nullptr); auto replCtx = std::make_shared<TReplCtx>( vctx, diff --git a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp index 08c32a8921e..9ed7de23f7f 100644 --- a/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp +++ b/ydb/core/blobstorage/vdisk/skeleton/blobstorage_skeletonfront.cpp @@ -1831,7 +1831,7 @@ namespace NKikimr { // add 'media' const auto media = cfg->BaseInfo.DeviceType; - vdiskCounters = vdiskCounters->GetSubgroup("media", to_lower(TPDiskCategory::DeviceTypeStr(media, true))); + vdiskCounters = vdiskCounters->GetSubgroup("media", to_lower(NPDisk::DeviceTypeStr(media, true))); return vdiskCounters; } diff --git a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp index 44808438bee..266ca6bef39 100644 --- a/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp +++ b/ydb/core/blobstorage/vdisk/synclog/blobstorage_synclogkeeper_ut.cpp @@ -76,7 +76,7 @@ namespace NKikimr { new NMonitoring::TDynamicCounters(), TVDiskID(), nullptr, - TPDiskCategory::DEVICE_TYPE_UNKNOWN); + NPDisk::DEVICE_TYPE_UNKNOWN); const ui64 pdiskGuid = 19283489374; const ui32 chunkSize = 512u << 10u; diff --git a/ydb/core/driver_lib/cli_utils/cli_cmds_genconfig.cpp b/ydb/core/driver_lib/cli_utils/cli_cmds_genconfig.cpp index af2801de362..e503162cf43 100644 --- a/ydb/core/driver_lib/cli_utils/cli_cmds_genconfig.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_cmds_genconfig.cpp @@ -270,8 +270,8 @@ public: pdiskItem.SetPath(pdiskInfo.Path); pdiskItem.SetPDiskGuid(pdiskInfo.PDiskGuid); - TPDiskCategory::EDeviceType deviceType = TPDiskCategory::DeviceTypeFromStr(pdiskInfo.Type); - if (deviceType == TPDiskCategory::DEVICE_TYPE_UNKNOWN) { + NPDisk::EDeviceType deviceType = NPDisk::DeviceTypeFromStr(pdiskInfo.Type); + if (deviceType == NPDisk::DEVICE_TYPE_UNKNOWN) { ythrow yexception() << "invalid PDisk Type " << pdiskInfo.Type; } const ui64 kind = 0; diff --git a/ydb/core/mind/bscontroller/config_fit_pdisks.cpp b/ydb/core/mind/bscontroller/config_fit_pdisks.cpp index d204f674ccf..565ea0582ce 100644 --- a/ydb/core/mind/bscontroller/config_fit_pdisks.cpp +++ b/ydb/core/mind/bscontroller/config_fit_pdisks.cpp @@ -54,8 +54,8 @@ namespace NKikimr { const NPDisk::TDriveData& driveData = nodeInfo.KnownDrives.at(serial.Serial); TString fsPath = driveData.Path; - TPDiskCategory::EDeviceType type = PDiskTypeToPDiskType(driveInfo->PDiskType); - if (type == TPDiskCategory::DEVICE_TYPE_UNKNOWN) { + NPDisk::EDeviceType type = PDiskTypeToPDiskType(driveInfo->PDiskType); + if (type == NPDisk::DEVICE_TYPE_UNKNOWN) { type = driveData.DeviceType; } const TPDiskCategory category(type, driveInfo->Kind); diff --git a/ydb/core/mind/bscontroller/impl.h b/ydb/core/mind/bscontroller/impl.h index 3b179e21dc9..e8d55783750 100644 --- a/ydb/core/mind/bscontroller/impl.h +++ b/ydb/core/mind/bscontroller/impl.h @@ -670,17 +670,17 @@ public: return values; } - TPDiskCategory::EDeviceType GetCommonDeviceType() const { + NPDisk::EDeviceType GetCommonDeviceType() const { if (VDisksInGroup) { - const TPDiskCategory::EDeviceType type = VDisksInGroup.front()->PDisk->Kind.Type(); + const NPDisk::EDeviceType type = VDisksInGroup.front()->PDisk->Kind.Type(); for (const TVSlotInfo *vslot : VDisksInGroup) { if (type != vslot->PDisk->Kind.Type()) { - return TPDiskCategory::DEVICE_TYPE_UNKNOWN; + return NPDisk::DEVICE_TYPE_UNKNOWN; } } return type; } else { - return TPDiskCategory::DEVICE_TYPE_UNKNOWN; + return NPDisk::DEVICE_TYPE_UNKNOWN; } } @@ -1257,7 +1257,7 @@ public: TMaybe<Table::Guid::Type> Guid; Table::LifeStage::Type LifeStage = NKikimrBlobStorage::TDriveLifeStage::UNKNOWN; Table::Kind::Type Kind = 0; - Table::PDiskType::Type PDiskType = PDiskTypeToPDiskType(TPDiskCategory::DEVICE_TYPE_UNKNOWN); + Table::PDiskType::Type PDiskType = PDiskTypeToPDiskType(NPDisk::DEVICE_TYPE_UNKNOWN); TMaybe<Table::PDiskConfig::Type> PDiskConfig; TDriveSerialInfo() = default; diff --git a/ydb/core/mind/bscontroller/register_node.cpp b/ydb/core/mind/bscontroller/register_node.cpp index 1e2959cb888..658e6d92b2e 100644 --- a/ydb/core/mind/bscontroller/register_node.cpp +++ b/ydb/core/mind/bscontroller/register_node.cpp @@ -27,7 +27,7 @@ class TBlobStorageController::TTxUpdateNodeDrives << data.GetPath() << " " << data.GetSerialNumber() << " " << data.GetModelNumber() << " " - << TPDiskCategory::DeviceTypeStr(PDiskTypeToPDiskType(data.GetDeviceType()), true) << " " + << NPDisk::DeviceTypeStr(PDiskTypeToPDiskType(data.GetDeviceType()), true) << " " << "}"; } out << "]"; @@ -120,9 +120,11 @@ class TBlobStorageController::TTxUpdateNodeDrives } else { Self->NodeForSerial[serial] = nodeId; } - auto [it, emplaced] = nodeInfo.KnownDrives.emplace(serial, data); - if (it->second.DeviceType == TPDiskCategory::DEVICE_TYPE_NVME) { - it->second.DeviceType = TPDiskCategory::DEVICE_TYPE_SSD; + NPDisk::TDriveData driveData; + DriveDataToDriveData(data, driveData); + auto [it, emplaced] = nodeInfo.KnownDrives.emplace(serial, driveData); + if (it->second.DeviceType == NPDisk::DEVICE_TYPE_NVME) { + it->second.DeviceType = NPDisk::DEVICE_TYPE_SSD; } } } diff --git a/ydb/library/pdisk_io/CMakeLists.darwin.txt b/ydb/library/pdisk_io/CMakeLists.darwin.txt index 38b1c2c476d..902a753e739 100644 --- a/ydb/library/pdisk_io/CMakeLists.darwin.txt +++ b/ydb/library/pdisk_io/CMakeLists.darwin.txt @@ -24,7 +24,10 @@ target_sources(ydb-library-pdisk_io PRIVATE ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio_map.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/buffers.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/device_type.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/drivedata.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/sector_map.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/wcache.cpp ) generate_enum_serilization(ydb-library-pdisk_io ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio.h diff --git a/ydb/library/pdisk_io/CMakeLists.linux.txt b/ydb/library/pdisk_io/CMakeLists.linux.txt index c1264a99e20..845369e1553 100644 --- a/ydb/library/pdisk_io/CMakeLists.linux.txt +++ b/ydb/library/pdisk_io/CMakeLists.linux.txt @@ -27,7 +27,10 @@ target_sources(ydb-library-pdisk_io PRIVATE ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio_map.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/buffers.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/device_type.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/drivedata.cpp ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/sector_map.cpp + ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/wcache.cpp ) generate_enum_serilization(ydb-library-pdisk_io ${CMAKE_SOURCE_DIR}/ydb/library/pdisk_io/aio.h diff --git a/ydb/library/pdisk_io/device_type.cpp b/ydb/library/pdisk_io/device_type.cpp new file mode 100644 index 00000000000..dd0c29e0b74 --- /dev/null +++ b/ydb/library/pdisk_io/device_type.cpp @@ -0,0 +1,30 @@ +#include "device_type.h" +#include <util/string/printf.h> + + +namespace NKikimr::NPDisk { + EDeviceType DeviceTypeFromStr(const TString &typeName) { + if (typeName == "ROT" || typeName == "DEVICE_TYPE_ROT") { + return DEVICE_TYPE_ROT; + } else if (typeName == "SSD" || typeName == "DEVICE_TYPE_SSD") { + return DEVICE_TYPE_SSD; + } else if (typeName == "NVME" || typeName == "DEVICE_TYPE_NVME") { + return DEVICE_TYPE_NVME; + } + return DEVICE_TYPE_UNKNOWN; + } + + TString DeviceTypeStr(const EDeviceType type, bool isShort) { + switch(type) { + case DEVICE_TYPE_ROT: + return isShort ? "ROT" : "DEVICE_TYPE_ROT"; + case DEVICE_TYPE_SSD: + return isShort ? "SSD" : "DEVICE_TYPE_SSD"; + case DEVICE_TYPE_NVME: + return isShort ? "NVME" : "DEVICE_TYPE_NVME"; + default: + return Sprintf("DEVICE_TYPE_UNKNOWN(%" PRIu64 ")", (ui64)type); + } + } + +} // NKikimr::NPDisk diff --git a/ydb/library/pdisk_io/device_type.h b/ydb/library/pdisk_io/device_type.h new file mode 100644 index 00000000000..56721512174 --- /dev/null +++ b/ydb/library/pdisk_io/device_type.h @@ -0,0 +1,17 @@ +#pragma once + +#include <util/generic/string.h> +#include <util/system/types.h> + +namespace NKikimr::NPDisk { + enum EDeviceType : ui8 { + DEVICE_TYPE_ROT = 0, + DEVICE_TYPE_SSD = 1, + DEVICE_TYPE_NVME = 2, + DEVICE_TYPE_UNKNOWN = 255, + }; + + TString DeviceTypeStr(const EDeviceType type, bool isShort); + EDeviceType DeviceTypeFromStr(const TString &typeName); + +} // NKikimr::NPDisk diff --git a/ydb/library/pdisk_io/drivedata.cpp b/ydb/library/pdisk_io/drivedata.cpp new file mode 100644 index 00000000000..8bd85bd38ac --- /dev/null +++ b/ydb/library/pdisk_io/drivedata.cpp @@ -0,0 +1,41 @@ +#include "drivedata.h" +#include "device_type.h" + +#include <util/stream/str.h> + +namespace NKikimr { +namespace NPDisk { + +TString TDriveData::ToString(bool isMultiline) const { + const char *x = isMultiline ? "\n" : ""; + TStringStream str; + str << "{Path# " << Path.Quote() << x + << " IsWriteCacheValid# " << IsWriteCacheValid << x + << " IsWriteCacheEnabled# " << IsWriteCacheEnabled << x + << " ModelNumber# " << ModelNumber.Quote() << x + << " SerialNumber# " << SerialNumber.Quote() << x + << " FirmwareRevision# " << FirmwareRevision.Quote() << x + << " DeviceType# " << NPDisk::DeviceTypeStr(DeviceType, true) << x + << "}" << x; + return str.Str(); +} + +bool operator==(const NPDisk::TDriveData& lhs, const NPDisk::TDriveData& rhs) { + return + lhs.Path == rhs.Path + // TODO(cthulhu): Use a map for the list of drives with path+model+serial as the key, not a vector + // so that operator== can actually check for equality. + // Consider serializing write cache state and processing it at the controller (system tables for example) + // && lhs.IsWriteCacheValid == rhs.IsWriteCacheValid + // && lhs.IsWriteCacheEnabled == rhs.IsWriteCacheEnabled + && lhs.SerialNumber == rhs.SerialNumber + && lhs.FirmwareRevision == rhs.FirmwareRevision + && lhs.ModelNumber == rhs.ModelNumber + && lhs.DeviceType == rhs.DeviceType + && lhs.Size == rhs.Size + && lhs.IsMock == rhs.IsMock; +} + + +} // NPDisk +} // NKikimr diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.h b/ydb/library/pdisk_io/drivedata.h index 5d024f03511..29ab26031e2 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.h +++ b/ydb/library/pdisk_io/drivedata.h @@ -1,12 +1,8 @@ #pragma once -#include <ydb/core/base/blobstorage_pdisk_category.h> +#include "device_type.h" #include <util/generic/string.h> -namespace NKikimrBlobStorage { -class TDriveData; -} - namespace NKikimr { namespace NPDisk { @@ -17,20 +13,16 @@ struct TDriveData { TString SerialNumber; TString FirmwareRevision; TString ModelNumber; - TPDiskCategory::EDeviceType DeviceType = TPDiskCategory::DEVICE_TYPE_UNKNOWN; + EDeviceType DeviceType = DEVICE_TYPE_UNKNOWN; ui64 Size = 0; bool IsMock = false; TDriveData() = default; - TDriveData(const NKikimrBlobStorage::TDriveData& p); - TString ToString(bool isMultiline) const; - - void ToProto(NKikimrBlobStorage::TDriveData *p) const; }; -bool operator==(const NPDisk::TDriveData& lhs, const NPDisk::TDriveData& rhs); +bool operator==(const TDriveData& lhs, const TDriveData& rhs); } // NPDisk } // NKikimr diff --git a/ydb/library/pdisk_io/file_params.h b/ydb/library/pdisk_io/file_params.h index 62203620a4a..46dab2109ab 100644 --- a/ydb/library/pdisk_io/file_params.h +++ b/ydb/library/pdisk_io/file_params.h @@ -1,6 +1,6 @@ #pragma once -#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_drivedata.h> +#include "drivedata.h" #include <util/folder/path.h> #include <optional> diff --git a/ydb/library/pdisk_io/file_params_linux.cpp b/ydb/library/pdisk_io/file_params_linux.cpp index 4b44328fe31..31de67b65e3 100644 --- a/ydb/library/pdisk_io/file_params_linux.cpp +++ b/ydb/library/pdisk_io/file_params_linux.cpp @@ -1,8 +1,9 @@ #include "file_params.h" -#include <ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.h> +#include <ydb/library/pdisk_io/drivedata.h> #include <ydb/library/pdisk_io/spdk_state.h> #include <ydb/library/pdisk_io/aio.h> +#include <ydb/library/pdisk_io/wcache.h> #include <linux/fs.h> #include <regex> diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp b/ydb/library/pdisk_io/wcache.cpp index f613c70bee8..134d07970eb 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.cpp +++ b/ydb/library/pdisk_io/wcache.cpp @@ -1,8 +1,10 @@ -#include "blobstorage_pdisk_util_wcache.h" -#include <library/cpp/actors/core/log.h> -#include <ydb/core/protos/services.pb.h> +#include "wcache.h" +//#include <library/cpp/actors/core/log.h> +//#include <ydb/core/protos/services.pb.h> +#include <util/generic/yexception.h> #include <util/stream/file.h> +#include <util/string/builder.h> #include <util/string/strip.h> #include <util/system/file.h> @@ -459,14 +461,14 @@ struct TIdentifyData { return GetString(27, 40); } - TPDiskCategory::EDeviceType GetDeviceType() const { + EDeviceType GetDeviceType() const { // "nominal media rotation rate" of HDD devices, equals to 1 for SSD if (Id[217] > 0x401) { - return TPDiskCategory::DEVICE_TYPE_ROT; + return DEVICE_TYPE_ROT; } else if (Id[217] == 1) { - return TPDiskCategory::DEVICE_TYPE_SSD; + return DEVICE_TYPE_SSD; } else { - return TPDiskCategory::DEVICE_TYPE_UNKNOWN; + return DEVICE_TYPE_UNKNOWN; } } @@ -615,7 +617,7 @@ static std::optional<TDriveData> GetNvmeDriveData(int fd, TStringStream *outDeta data.SerialNumber = RenderCharField(id + NVME_ID_SERIAL_NUMBER_OFFSET, NVME_ID_SERIAL_NUMBER_SIZE); data.ModelNumber = RenderCharField(id + NVME_ID_MODEL_NUMBER_OFFSET, NVME_ID_MODEL_NUMBER_SIZE); data.FirmwareRevision = RenderCharField(id + NVME_ID_FIRMWARE_REVISION_OFFSET, NVME_ID_FIRMWARE_REVISION_SIZE); - data.DeviceType = TPDiskCategory::DEVICE_TYPE_NVME; + data.DeviceType = DEVICE_TYPE_NVME; return data; } else { return std::nullopt; @@ -654,7 +656,7 @@ static std::optional<TDriveData> GetSysfsDriveData(const TString &path, TStringS data.SerialNumber = readField("device/serial"); data.ModelNumber = readField("device/model"); data.FirmwareRevision = readField("device/firmware_rev"); - data.DeviceType = TPDiskCategory::DEVICE_TYPE_NVME; + data.DeviceType = DEVICE_TYPE_NVME; return data; } catch (const TFileError& err) { *outDetails << "can't open sysfs files, caught TFileError, what# " << err.what(); diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.h b/ydb/library/pdisk_io/wcache.h index 86129e68f25..09b98f6818e 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_util_wcache.h +++ b/ydb/library/pdisk_io/wcache.h @@ -1,6 +1,7 @@ #pragma once -#include "blobstorage_pdisk_drivedata.h" +#include <ydb/library/pdisk_io/drivedata.h> +#include <util/stream/str.h> #include <util/system/file.h> #include <optional> |