diff options
author | alexvru <alexvru@ydb.tech> | 2022-10-27 11:41:26 +0300 |
---|---|---|
committer | alexvru <alexvru@ydb.tech> | 2022-10-27 11:41:26 +0300 |
commit | f414f1f14408c03972e5b9ae8f968df1ed493a69 (patch) | |
tree | 8f39da91936e7d7d89bcf1192bec3c3c29f29e95 | |
parent | ece326b79de0c6cdff0c40d6903316682bda3c00 (diff) | |
download | ydb-f414f1f14408c03972e5b9ae8f968df1ed493a69.tar.gz |
Propose tablet storage binding interface change
-rw-r--r-- | ydb/core/base/hive.h | 5 | ||||
-rw-r--r-- | ydb/core/mind/hive/hive_impl.cpp | 22 | ||||
-rw-r--r-- | ydb/core/protos/bind_channel_storage_pool.proto | 1 | ||||
-rw-r--r-- | ydb/core/protos/blobstorage.proto | 1 | ||||
-rw-r--r-- | ydb/core/protos/hive.proto | 4 |
5 files changed, 30 insertions, 3 deletions
diff --git a/ydb/core/base/hive.h b/ydb/core/base/hive.h index 7d4ae4cb51e..37b1305e9d7 100644 --- a/ydb/core/base/hive.h +++ b/ydb/core/base/hive.h @@ -75,6 +75,7 @@ namespace NKikimr { EvInitMigrationReply, EvQueryMigrationReply, EvTabletOwnersReply, + EvInvalidateStoragePoolsReply, EvEnd }; @@ -748,6 +749,10 @@ namespace NKikimr { TEvInvalidateStoragePools() = default; }; + struct TEvInvalidateStoragePoolsReply : TEventPB<TEvInvalidateStoragePoolsReply, NKikimrHive::TEvInvalidateStoragePoolsReply, EvInvalidateStoragePoolsReply> { + TEvInvalidateStoragePoolsReply() = default; + }; + struct TEvRequestHiveNodeStats : TEventPB<TEvRequestHiveNodeStats, NKikimrHive::TEvRequestHiveNodeStats, EvRequestHiveNodeStats> { TEvRequestHiveNodeStats() = default; }; diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 2dfb33dbb95..f5fa06659cb 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -2335,10 +2335,26 @@ THive::THive(TTabletStorageInfo *info, const TActorId &tablet) TabletCounters = TabletCountersPtr.Get(); } -void THive::Handle(TEvHive::TEvInvalidateStoragePools::TPtr&) { - for (auto& pr : StoragePools) { - pr.second.Invalidate(); +void THive::Handle(TEvHive::TEvInvalidateStoragePools::TPtr& ev) { + auto& record = ev->Get()->Record; + if (record.StoragePoolNameSize()) { + for (const auto& name : record.GetStoragePoolName()) { + if (const auto it = StoragePools.find(name); it != StoragePools.end()) { + it->second.Invalidate(); + } + } + } else { + for (auto& [_, pool] : StoragePools) { + pool.Invalidate(); + } + } + + auto reply = std::make_unique<TEvHive::TEvInvalidateStoragePoolsReply>(); + auto handle = std::make_unique<IEventHandle>(ev->Sender, SelfId(), reply.release()); + if (ev->InterconnectSession) { + handle->Rewrite(TEvInterconnect::EvForward, ev->InterconnectSession); } + TActivationContext::Send(handle.release()); } void THive::InitDefaultChannelBind(TChannelBind& bind) { diff --git a/ydb/core/protos/bind_channel_storage_pool.proto b/ydb/core/protos/bind_channel_storage_pool.proto index f9b1943aae6..213aab361e8 100644 --- a/ydb/core/protos/bind_channel_storage_pool.proto +++ b/ydb/core/protos/bind_channel_storage_pool.proto @@ -12,4 +12,5 @@ message TChannelBind { optional float IOPS = 10; optional uint64 Throughput = 11; optional uint64 Size = 12; + optional bool PhysicalGroupsOnly = 20; // default: true for channels 0, 1 and false for other channels } diff --git a/ydb/core/protos/blobstorage.proto b/ydb/core/protos/blobstorage.proto index 2c0778a7894..6f48b73113d 100644 --- a/ydb/core/protos/blobstorage.proto +++ b/ydb/core/protos/blobstorage.proto @@ -1282,6 +1282,7 @@ message TEvControllerSelectGroupsResult { optional uint32 ErasureSpecies = 1; optional uint32 GroupID = 2; optional string StoragePoolName = 3; // if it was selected from the storage pool + optional bool PhysicalGroup = 12; // related to TChannelBind.PhysicalGroupsOnly reserved 4; diff --git a/ydb/core/protos/hive.proto b/ydb/core/protos/hive.proto index 659a158eaf5..642e9827e00 100644 --- a/ydb/core/protos/hive.proto +++ b/ydb/core/protos/hive.proto @@ -406,6 +406,10 @@ message TEvUnlockTabletExecutionResult { } message TEvInvalidateStoragePools { + repeated string StoragePoolName = 1; // if none given, invalidate all pools +} + +message TEvInvalidateStoragePoolsReply { } message TEvRequestTabletIdSequence { |