diff options
author | krasnobaev <krasnobaev@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:19 +0300 |
commit | 57d5924cfae7600e91d372034c64914e0a0b6396 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | 408b62b8b2bb0540f9251bb682b01b4d585d3754 (diff) | |
download | ydb-57d5924cfae7600e91d372034c64914e0a0b6396.tar.gz |
Restoring authorship annotation for <krasnobaev@yandex-team.ru>. Commit 2 of 2.
26 files changed, 200 insertions, 200 deletions
diff --git a/library/cpp/actors/core/log.cpp b/library/cpp/actors/core/log.cpp index 74e86f3d89..5f63b5af58 100644 --- a/library/cpp/actors/core/log.cpp +++ b/library/cpp/actors/core/log.cpp @@ -702,19 +702,19 @@ namespace NActors { const TString Indent; }; - class TLineFileLogBackend: public TFileLogBackend { - public: - TLineFileLogBackend(const TString& path) - : TFileLogBackend(path) + class TLineFileLogBackend: public TFileLogBackend { + public: + TLineFileLogBackend(const TString& path) + : TFileLogBackend(path) { } - - // Append newline after every record - void WriteData(const TLogRecord& rec) override { + + // Append newline after every record + void WriteData(const TLogRecord& rec) override { TFileLogBackend::WriteData(TRecordWithNewline(rec)); - } - }; - + } + }; + class TCompositeLogBackend: public TLogBackend { public: TCompositeLogBackend(TVector<TAutoPtr<TLogBackend>>&& underlyingBackends) @@ -740,7 +740,7 @@ namespace NActors { } TAutoPtr<TLogBackend> CreateFileBackend(const TString& fileName) { - return new TLineFileLogBackend(fileName); + return new TLineFileLogBackend(fileName); } TAutoPtr<TLogBackend> CreateNullBackend() { diff --git a/library/cpp/grpc/client/grpc_common.h b/library/cpp/grpc/client/grpc_common.h index 35faabfca5..ffcdafe045 100644 --- a/library/cpp/grpc/client/grpc_common.h +++ b/library/cpp/grpc/client/grpc_common.h @@ -3,7 +3,7 @@ #include <grpc++/grpc++.h> #include <grpc++/resource_quota.h> -#include <util/datetime/base.h> +#include <util/datetime/base.h> #include <unordered_map> #include <util/generic/string.h> @@ -20,7 +20,7 @@ struct TGRpcClientConfig { ui32 MaxInFlight = 0; bool EnableSsl = false; TString SslCaCert; //Implicitly enables Ssl if not empty - grpc_compression_algorithm CompressionAlgoritm = GRPC_COMPRESS_NONE; + grpc_compression_algorithm CompressionAlgoritm = GRPC_COMPRESS_NONE; ui64 MemQuota = 0; std::unordered_map<TString, TString> StringChannelParams; std::unordered_map<TString, int> IntChannelParams; @@ -34,7 +34,7 @@ struct TGRpcClientConfig { TGRpcClientConfig& operator=(TGRpcClientConfig&&) = default; TGRpcClientConfig(const TString& locator, TDuration timeout = TDuration::Max(), - ui64 maxMessageSize = DEFAULT_GRPC_MESSAGE_SIZE_LIMIT, ui32 maxInFlight = 0, TString caCert = "", + ui64 maxMessageSize = DEFAULT_GRPC_MESSAGE_SIZE_LIMIT, ui32 maxInFlight = 0, TString caCert = "", grpc_compression_algorithm compressionAlgorithm = GRPC_COMPRESS_NONE, bool enableSsl = false) : Locator(locator) , Timeout(timeout) @@ -42,7 +42,7 @@ struct TGRpcClientConfig { , MaxInFlight(maxInFlight) , EnableSsl(enableSsl) , SslCaCert(caCert) - , CompressionAlgoritm(compressionAlgorithm) + , CompressionAlgoritm(compressionAlgorithm) {} }; @@ -50,16 +50,16 @@ inline std::shared_ptr<grpc::ChannelInterface> CreateChannelInterface(const TGRp grpc::ChannelArguments args; args.SetMaxReceiveMessageSize(config.MaxInboundMessageSize ? config.MaxInboundMessageSize : config.MaxMessageSize); args.SetMaxSendMessageSize(config.MaxOutboundMessageSize ? config.MaxOutboundMessageSize : config.MaxMessageSize); - args.SetCompressionAlgorithm(config.CompressionAlgoritm); + args.SetCompressionAlgorithm(config.CompressionAlgoritm); + + for (const auto& kvp: config.StringChannelParams) { + args.SetString(kvp.first, kvp.second); + } + + for (const auto& kvp: config.IntChannelParams) { + args.SetInt(kvp.first, kvp.second); + } - for (const auto& kvp: config.StringChannelParams) { - args.SetString(kvp.first, kvp.second); - } - - for (const auto& kvp: config.IntChannelParams) { - args.SetInt(kvp.first, kvp.second); - } - if (config.MemQuota) { grpc::ResourceQuota quota; quota.Resize(config.MemQuota); diff --git a/library/cpp/grpc/server/grpc_async_ctx_base.h b/library/cpp/grpc/server/grpc_async_ctx_base.h index 8fbce61f94..51356d4ce5 100644 --- a/library/cpp/grpc/server/grpc_async_ctx_base.h +++ b/library/cpp/grpc/server/grpc_async_ctx_base.h @@ -69,10 +69,10 @@ public: return values; } - grpc_compression_level GetCompressionLevel() const { - return Context.compression_level(); - } - + grpc_compression_level GetCompressionLevel() const { + return Context.compression_level(); + } + void Shutdown() override { // Shutdown may only be called after request has started successfully if (Context.c_call()) diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h index 345637e86d..5bd8d3902b 100644 --- a/library/cpp/grpc/server/grpc_request.h +++ b/library/cpp/grpc/server/grpc_request.h @@ -167,10 +167,10 @@ public: return TBaseAsyncContext<TService>::GetPeerMetaValues(key); } - grpc_compression_level GetCompressionLevel() const override { - return TBaseAsyncContext<TService>::GetCompressionLevel(); - } - + grpc_compression_level GetCompressionLevel() const override { + return TBaseAsyncContext<TService>::GetCompressionLevel(); + } + //! Get pointer to the request's message. const NProtoBuf::Message* GetRequest() const override { return Request_; diff --git a/library/cpp/grpc/server/grpc_request_base.h b/library/cpp/grpc/server/grpc_request_base.h index 5d5e11239e..fcfce1c181 100644 --- a/library/cpp/grpc/server/grpc_request_base.h +++ b/library/cpp/grpc/server/grpc_request_base.h @@ -3,8 +3,8 @@ #include <google/protobuf/message.h> #include <library/cpp/threading/future/future.h> -#include <grpc++/server_context.h> - +#include <grpc++/server_context.h> + namespace grpc { class ByteBuffer; } @@ -79,9 +79,9 @@ public: //! Returns peer optional metavalue virtual TVector<TStringBuf> GetPeerMetaValues(TStringBuf key) const = 0; - //! Returns request compression level - virtual grpc_compression_level GetCompressionLevel() const = 0; - + //! Returns request compression level + virtual grpc_compression_level GetCompressionLevel() const = 0; + //! Returns protobuf arena allocator associated with current request //! Lifetime of the arena is lifetime of the context virtual google::protobuf::Arena* GetArena() = 0; diff --git a/library/cpp/grpc/server/grpc_server.cpp b/library/cpp/grpc/server/grpc_server.cpp index 07dca78a37..7437b7a8f5 100644 --- a/library/cpp/grpc/server/grpc_server.cpp +++ b/library/cpp/grpc/server/grpc_server.cpp @@ -142,8 +142,8 @@ void TGRpcServer::Start() { */ Cerr << "GRpc memory quota temporarily disabled due to issues with grpc quoter" << Endl; } - Options_.ServerBuilderMutator(builder); - builder.SetDefaultCompressionLevel(Options_.DefaultCompressionLevel); + Options_.ServerBuilderMutator(builder); + builder.SetDefaultCompressionLevel(Options_.DefaultCompressionLevel); Server_ = builder.BuildAndStart(); if (!Server_) { diff --git a/library/cpp/grpc/server/grpc_server.h b/library/cpp/grpc/server/grpc_server.h index a43cdef142..d6814a90a0 100644 --- a/library/cpp/grpc/server/grpc_server.h +++ b/library/cpp/grpc/server/grpc_server.h @@ -85,14 +85,14 @@ struct TServerOptions { //! GRPC auth DECLARE_FIELD(UseAuth, bool, false); - - //! Default compression level. Used when no compression options provided by client. - // Mapping to particular compression algorithm depends on client. - DECLARE_FIELD(DefaultCompressionLevel, grpc_compression_level, GRPC_COMPRESS_LEVEL_NONE); - - //! Custom configurator for ServerBuilder. - DECLARE_FIELD(ServerBuilderMutator, std::function<void(grpc::ServerBuilder&)>, [](grpc::ServerBuilder&){}); - + + //! Default compression level. Used when no compression options provided by client. + // Mapping to particular compression algorithm depends on client. + DECLARE_FIELD(DefaultCompressionLevel, grpc_compression_level, GRPC_COMPRESS_LEVEL_NONE); + + //! Custom configurator for ServerBuilder. + DECLARE_FIELD(ServerBuilderMutator, std::function<void(grpc::ServerBuilder&)>, [](grpc::ServerBuilder&){}); + DECLARE_FIELD(ExternalListener, IExternalListener::TPtr, nullptr); //! Logger which will be used to write logs about requests handling (iff appropriate log level is enabled). diff --git a/ydb/core/base/hive.h b/ydb/core/base/hive.h index d3fa538825..7464c76699 100644 --- a/ydb/core/base/hive.h +++ b/ydb/core/base/hive.h @@ -31,7 +31,7 @@ namespace NKikimr { EvGetTabletStorageInfo, EvLockTabletExecution, EvUnlockTabletExecution, - EvInitiateTabletExternalBoot, + EvInitiateTabletExternalBoot, EvRequestHiveDomainStats, EvAdoptTable, EvInvalidateStoragePools, @@ -699,16 +699,16 @@ namespace NKikimr { Record.SetStatusMessage(statusMessage); } }; - - struct TEvInitiateTabletExternalBoot : public TEventPB<TEvInitiateTabletExternalBoot, - NKikimrHive::TEvBootTablet, EvInitiateTabletExternalBoot> - { - TEvInitiateTabletExternalBoot() = default; - - explicit TEvInitiateTabletExternalBoot(ui64 tabletId) { - Record.SetTabletID(tabletId); - } - }; + + struct TEvInitiateTabletExternalBoot : public TEventPB<TEvInitiateTabletExternalBoot, + NKikimrHive::TEvBootTablet, EvInitiateTabletExternalBoot> + { + TEvInitiateTabletExternalBoot() = default; + + explicit TEvInitiateTabletExternalBoot(ui64 tabletId) { + Record.SetTabletID(tabletId); + } + }; struct TEvRequestHiveDomainStats : TEventPB<TEvRequestHiveDomainStats, NKikimrHive::TEvRequestHiveDomainStats, EvRequestHiveDomainStats> { TEvRequestHiveDomainStats() = default; diff --git a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp index b24712b949..d00fc0f220 100644 --- a/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp +++ b/ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl.cpp @@ -2101,7 +2101,7 @@ void TPDisk::OnDriveStartup() { if (DriveData.IsWriteCacheValid && !DriveData.IsWriteCacheEnabled) { BlockDevice->SetWriteCache(true); isChanged = true; - str << " Attempted enabling the disabled Write Cache."; + str << " Attempted enabling the disabled Write Cache."; } else { str << " Write cache is not disabled, no need to enable it."; } @@ -2109,7 +2109,7 @@ void TPDisk::OnDriveStartup() { case NKikimrBlobStorage::TPDiskConfig::ForceEnable: BlockDevice->SetWriteCache(true); isChanged = true; - str << " Attempted force-enabling the Write Cache."; + str << " Attempted force-enabling the Write Cache."; break; case NKikimrBlobStorage::TPDiskConfig::Disable: if (DriveData.IsWriteCacheValid && DriveData.IsWriteCacheEnabled) { @@ -2122,7 +2122,7 @@ void TPDisk::OnDriveStartup() { case NKikimrBlobStorage::TPDiskConfig::ForceDisable: BlockDevice->SetWriteCache(false); isChanged = true; - str << "Attempted force-disabling the Write Cache."; + str << "Attempted force-disabling the Write Cache."; break; default: break; diff --git a/ydb/core/mind/hive/hive_impl.cpp b/ydb/core/mind/hive/hive_impl.cpp index 1bb8290c62..58ca2ac3e4 100644 --- a/ydb/core/mind/hive/hive_impl.cpp +++ b/ydb/core/mind/hive/hive_impl.cpp @@ -1833,30 +1833,30 @@ void THive::Handle(TEvHive::TEvFillNode::TPtr& ev) { void THive::Handle(TEvHive::TEvInitiateTabletExternalBoot::TPtr& ev) { TTabletId tabletId = ev->Get()->Record.GetTabletID(); TLeaderTabletInfo* tablet = FindTablet(tabletId); - - if (!tablet) { + + if (!tablet) { Send(ev->Sender, new TEvHive::TEvBootTabletReply(NKikimrProto::EReplyStatus::ERROR), 0, ev->Cookie); BLOG_ERROR("Tablet not found " << tabletId); - return; - } - + return; + } + if (tablet->State == ETabletState::GroupAssignment || tablet->State == ETabletState::BlockStorage) { Send(ev->Sender, new TEvHive::TEvBootTabletReply(NKikimrProto::EReplyStatus::TRYLATER), 0, ev->Cookie); BLOG_W("Tablet waiting for group assignment " << tabletId); - return; - } - + return; + } + if (!tablet->IsBootingSuppressed()) { Send(ev->Sender, new TEvHive::TEvBootTabletReply(NKikimrProto::EReplyStatus::ERROR), 0, ev->Cookie); BLOG_ERROR("Tablet " << tabletId << " is not expected to boot externally"); - return; - } - + return; + } + Execute(CreateStartTablet(TFullTabletId(tabletId, 0), ev->Sender, ev->Cookie, /* external */ true)); -} - +} + void THive::Handle(NConsole::TEvConsole::TEvConfigNotificationRequest::TPtr& ev) { const NKikimrConsole::TConfigNotificationRequest& record = ev->Get()->Record; ClusterConfig = record.GetConfig().GetHiveConfig(); diff --git a/ydb/core/mind/hive/hive_ut.cpp b/ydb/core/mind/hive/hive_ut.cpp index 1cfeb98c54..0383d49a12 100644 --- a/ydb/core/mind/hive/hive_ut.cpp +++ b/ydb/core/mind/hive/hive_ut.cpp @@ -4357,33 +4357,33 @@ Y_UNIT_TEST_SUITE(THiveTest) { // Hive should notify the old owner on unlocking VerifyLockTabletExecutionLost(runtime, tabletId, owner); } - + Y_UNIT_TEST(TestExternalBoot) { TTestBasicRuntime runtime(1, false); - Setup(runtime, true); - CreateLocal(runtime, 0); // only the 1st node has local running - const ui64 hiveTablet = MakeDefaultHiveID(0); - const ui64 testerTablet = MakeDefaultHiveID(1); + Setup(runtime, true); + CreateLocal(runtime, 0); // only the 1st node has local running + const ui64 hiveTablet = MakeDefaultHiveID(0); + const ui64 testerTablet = MakeDefaultHiveID(1); CreateTestBootstrapper(runtime, CreateTestTabletInfo(hiveTablet, TTabletTypes::FLAT_HIVE), &CreateDefaultHive); - + TAutoPtr<TEvHive::TEvCreateTablet> ev = new TEvHive::TEvCreateTablet(testerTablet, 0, TTabletTypes::Dummy, BINDED_CHANNELS); - ev->Record.SetTabletBootMode(NKikimrHive::ETabletBootMode::TABLET_BOOT_MODE_EXTERNAL); + ev->Record.SetTabletBootMode(NKikimrHive::ETabletBootMode::TABLET_BOOT_MODE_EXTERNAL); ui64 tabletId = SendCreateTestTablet(runtime, hiveTablet, testerTablet, std::move(ev), 0, true); - + TActorId owner1 = runtime.AllocateEdgeActor(0); - runtime.SendToPipe(hiveTablet, owner1, new TEvHive::TEvInitiateTabletExternalBoot(tabletId), 0, GetPipeConfigWithRetries()); - - TAutoPtr<IEventHandle> handle; - auto* result = runtime.GrabEdgeEvent<TEvLocal::TEvBootTablet>(handle); - UNIT_ASSERT(result); + runtime.SendToPipe(hiveTablet, owner1, new TEvHive::TEvInitiateTabletExternalBoot(tabletId), 0, GetPipeConfigWithRetries()); + + TAutoPtr<IEventHandle> handle; + auto* result = runtime.GrabEdgeEvent<TEvLocal::TEvBootTablet>(handle); + UNIT_ASSERT(result); UNIT_ASSERT_VALUES_EQUAL(result->Record.GetSuggestedGeneration(), 1); UNIT_ASSERT_EQUAL(result->Record.GetBootMode(), NKikimrLocal::EBootMode::BOOT_MODE_LEADER); - - const auto& storageInfo = result->Record.GetInfo(); - UNIT_ASSERT_EQUAL(storageInfo.GetTabletID(), tabletId); - UNIT_ASSERT_EQUAL(storageInfo.GetTabletType(), TTabletTypes::Dummy); - UNIT_ASSERT(storageInfo.ChannelsSize() > 0); - } + + const auto& storageInfo = result->Record.GetInfo(); + UNIT_ASSERT_EQUAL(storageInfo.GetTabletID(), tabletId); + UNIT_ASSERT_EQUAL(storageInfo.GetTabletType(), TTabletTypes::Dummy); + UNIT_ASSERT(storageInfo.ChannelsSize() > 0); + } Y_UNIT_TEST(TestExternalBootWhenLocked) { TTestBasicRuntime runtime(2, false); diff --git a/ydb/core/protos/counters_schemeshard.proto b/ydb/core/protos/counters_schemeshard.proto index 0c0b667420..a839915c98 100644 --- a/ydb/core/protos/counters_schemeshard.proto +++ b/ydb/core/protos/counters_schemeshard.proto @@ -20,8 +20,8 @@ enum ESimpleCounters { COUNTER_SUB_DOMAIN_COUNT = 9 [(CounterOpts) = {Name: "SubDomains"}]; COUNTER_SUB_DOMAIN_COORDINATOR_COUNT = 10 [(CounterOpts) = {Name: "SubDomainsCoordinators"}]; COUNTER_SUB_DOMAIN_MEDIATOR_COUNT = 11 [(CounterOpts) = {Name: "SubDomainsMediators"}]; - COUNTER_RTMR_VOLUME_COUNT = 12 [(CounterOpts) = {Name: "RtmrVolumesCount"}]; - COUNTER_RTMR_PARTITIONS_COUNT = 13 [(CounterOpts) = {Name: "RtmrPartitionsCount"}]; + COUNTER_RTMR_VOLUME_COUNT = 12 [(CounterOpts) = {Name: "RtmrVolumesCount"}]; + COUNTER_RTMR_PARTITIONS_COUNT = 13 [(CounterOpts) = {Name: "RtmrPartitionsCount"}]; COUNTER_BLOCKSTORE_VOLUME_COUNT = 14 [(CounterOpts) = {Name: "BlockStoreVolumes"}]; COUNTER_BLOCKSTORE_VOLUME_SHARD_COUNT = 15 [(CounterOpts) = {Name: "BlockStoreVolumeShards"}]; COUNTER_BLOCKSTORE_PARTITION_SHARD_COUNT = 16 [(CounterOpts) = {Name: "BlockStorePartitionShards"}]; diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto index 9ab747786a..33e598c1c2 100644 --- a/ydb/core/protos/flat_scheme_op.proto +++ b/ydb/core/protos/flat_scheme_op.proto @@ -919,19 +919,19 @@ message TPersQueueGroupDescription { optional NKikimrPQ.TBootstrapConfig BootstrapConfig = 13; } -message TRtmrVolumeDescription { - message TPartition { - optional bytes PartitionId = 1; - optional uint64 BusKey = 2; - optional uint64 TabletId = 3; - } - - optional string Name = 1; - optional uint64 PathId = 2; - optional uint64 PartitionsCount = 3; - repeated TPartition Partitions = 4; -} - +message TRtmrVolumeDescription { + message TPartition { + optional bytes PartitionId = 1; + optional uint64 BusKey = 2; + optional uint64 TabletId = 3; + } + + optional string Name = 1; + optional uint64 PathId = 2; + optional uint64 PartitionsCount = 3; + repeated TPartition Partitions = 4; +} + message TBlockStoreVolumeDescription { message TPartition { optional uint32 PartitionId = 1; @@ -1080,7 +1080,7 @@ enum EOperationType { ESchemeOpBackup = 11; ESchemeOpCreateSubDomain = 12; ESchemeOpDropSubDomain = 13; - ESchemeOpCreateRtmrVolume = 14; + ESchemeOpCreateRtmrVolume = 14; ESchemeOpCreateBlockStoreVolume = 15; ESchemeOpAlterBlockStoreVolume = 16; ESchemeOpAssignBlockStoreVolume = 17; @@ -1235,7 +1235,7 @@ message TModifyScheme { optional TSplitMergeTablePartitions SplitMergeTablePartitions = 10; optional TBackupTask Backup = 11; optional NKikimrSubDomains.TSubDomainSettings SubDomain = 12; - optional TRtmrVolumeDescription CreateRtmrVolume = 13; + optional TRtmrVolumeDescription CreateRtmrVolume = 13; optional TBlockStoreVolumeDescription CreateBlockStoreVolume = 14; optional TBlockStoreVolumeDescription AlterBlockStoreVolume = 15; optional TBlockStoreAssignOp AssignBlockStoreVolume = 16; @@ -1314,7 +1314,7 @@ enum EPathType { EPathTypeTable = 2; EPathTypePersQueueGroup = 3; EPathTypeSubDomain = 4; - EPathTypeRtmrVolume = 5; + EPathTypeRtmrVolume = 5; EPathTypeBlockStoreVolume = 6; EPathTypeKesus = 7; EPathTypeSolomonVolume = 8; @@ -1445,7 +1445,7 @@ message TPathDescription { optional NKikimrTableStats.TTableStats TableStats = 8; optional NKikimrTabletBase.TMetrics TabletMetrics = 9; optional NKikimrSubDomains.TDomainDescription DomainDescription = 10; - optional TRtmrVolumeDescription RtmrVolumeDescription = 11; // for rtmr volume + optional TRtmrVolumeDescription RtmrVolumeDescription = 11; // for rtmr volume optional TBlockStoreVolumeDescription BlockStoreVolumeDescription = 12; optional TKesusDescription Kesus = 13; optional TSolomonVolumeDescription SolomonDescription = 14; diff --git a/ydb/core/protos/ya.make b/ydb/core/protos/ya.make index c5ac6c1716..70bb65514c 100644 --- a/ydb/core/protos/ya.make +++ b/ydb/core/protos/ya.make @@ -131,8 +131,8 @@ SRCS( sys_view.proto ) -GENERATE_ENUM_SERIALIZATION(blobstorage_pdisk_config.pb.h) - +GENERATE_ENUM_SERIALIZATION(blobstorage_pdisk_config.pb.h) + PEERDIR( library/cpp/actors/protos ydb/core/yq/libs/config/protos diff --git a/ydb/core/testlib/tablet_helpers.cpp b/ydb/core/testlib/tablet_helpers.cpp index 7f262cf8ea..a853040b93 100644 --- a/ydb/core/testlib/tablet_helpers.cpp +++ b/ydb/core/testlib/tablet_helpers.cpp @@ -1134,7 +1134,7 @@ namespace NKikimr { HFunc(TEvHive::TEvDeleteTablet, Handle); HFunc(TEvHive::TEvDeleteOwnerTablets, Handle); HFunc(TEvHive::TEvRequestHiveInfo, Handle); - HFunc(TEvHive::TEvInitiateTabletExternalBoot, Handle); + HFunc(TEvHive::TEvInitiateTabletExternalBoot, Handle); HFunc(TEvFakeHive::TEvSubscribeToTabletDeletion, Handle); HFunc(TEvents::TEvPoisonPill, Handle); } @@ -1368,21 +1368,21 @@ namespace NKikimr { ctx.Send(ev->Sender, response.Release()); } - void Handle(TEvHive::TEvInitiateTabletExternalBoot::TPtr &ev, const TActorContext &ctx) { - ui64 tabletId = ev->Get()->Record.GetTabletID(); + void Handle(TEvHive::TEvInitiateTabletExternalBoot::TPtr &ev, const TActorContext &ctx) { + ui64 tabletId = ev->Get()->Record.GetTabletID(); if (!State->TabletIdToOwner.contains(tabletId)) { - ctx.Send(ev->Sender, new TEvHive::TEvBootTabletReply(NKikimrProto::EReplyStatus::ERROR), 0, ev->Cookie); - return; - } - - auto key = State->TabletIdToOwner[tabletId]; - auto it = State->Tablets.find(key); - Y_VERIFY(it != State->Tablets.end()); - + ctx.Send(ev->Sender, new TEvHive::TEvBootTabletReply(NKikimrProto::EReplyStatus::ERROR), 0, ev->Cookie); + return; + } + + auto key = State->TabletIdToOwner[tabletId]; + auto it = State->Tablets.find(key); + Y_VERIFY(it != State->Tablets.end()); + THolder<TTabletStorageInfo> tabletInfo(CreateTestTabletInfo(tabletId, it->second.Type)); - ctx.Send(ev->Sender, new TEvLocal::TEvBootTablet(*tabletInfo.Get(), 0), 0, ev->Cookie); - } - + ctx.Send(ev->Sender, new TEvLocal::TEvBootTablet(*tabletInfo.Get(), 0), 0, ev->Cookie); + } + void Handle(TEvFakeHive::TEvSubscribeToTabletDeletion::TPtr &ev, const TActorContext &ctx) { ui64 tabletId = ev->Get()->TabletId; auto it = State->TabletIdToOwner.find(tabletId); diff --git a/ydb/core/tx/scheme_cache/scheme_cache.h b/ydb/core/tx/scheme_cache/scheme_cache.h index 6dcff95a40..26a07897a1 100644 --- a/ydb/core/tx/scheme_cache/scheme_cache.h +++ b/ydb/core/tx/scheme_cache/scheme_cache.h @@ -113,7 +113,7 @@ struct TSchemeCacheNavigate { KindPath = 2, KindTable = 3, KindTopic = 4, - KindRtmr = 5, + KindRtmr = 5, KindKesus = 6, KindSolomon = 7, KindSubdomain = 8, @@ -159,11 +159,11 @@ struct TSchemeCacheNavigate { NKikimrSchemeOp::TPersQueueGroupDescription Description; }; - struct TRtmrVolumeInfo : public TAtomicRefCount<TRtmrVolumeInfo> { - EKind Kind = KindUnknown; + struct TRtmrVolumeInfo : public TAtomicRefCount<TRtmrVolumeInfo> { + EKind Kind = KindUnknown; NKikimrSchemeOp::TRtmrVolumeDescription Description; - }; - + }; + struct TKesusInfo : public TAtomicRefCount<TKesusInfo> { EKind Kind = KindUnknown; NKikimrSchemeOp::TKesusDescription Description; @@ -237,7 +237,7 @@ struct TSchemeCacheNavigate { // other TIntrusiveConstPtr<TDomainDescription> DomainDescription; TIntrusiveConstPtr<TPQGroupInfo> PQGroupInfo; - TIntrusiveConstPtr<TRtmrVolumeInfo> RTMRVolumeInfo; + TIntrusiveConstPtr<TRtmrVolumeInfo> RTMRVolumeInfo; TIntrusiveConstPtr<TKesusInfo> KesusInfo; TIntrusiveConstPtr<TSolomonVolumeInfo> SolomonVolumeInfo; TIntrusiveConstPtr<TOlapStoreInfo> OlapStoreInfo; diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 0546608d4b..650506549e 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -2340,57 +2340,57 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { } - // Read RTMR volumes - { - auto rowset = db.Table<Schema::RtmrVolumes>().Range().Select(); - if (!rowset.IsReady()) - return false; - - while (!rowset.EndOfSet()) { + // Read RTMR volumes + { + auto rowset = db.Table<Schema::RtmrVolumes>().Range().Select(); + if (!rowset.IsReady()) + return false; + + while (!rowset.EndOfSet()) { TLocalPathId localPathId = rowset.GetValue<Schema::RtmrVolumes::PathId>(); TPathId pathId(selfId, localPathId); - Self->RtmrVolumes[pathId] = new TRtmrVolumeInfo(); + Self->RtmrVolumes[pathId] = new TRtmrVolumeInfo(); Self->IncrementPathDbRefCount(pathId); - - if (!rowset.Next()) - return false; - } - } - - // Read RTMR partitions - { - auto rowset = db.Table<Schema::RTMRPartitions>().Range().Select(); - if (!rowset.IsReady()) - return false; - - while (!rowset.EndOfSet()) { + + if (!rowset.Next()) + return false; + } + } + + // Read RTMR partitions + { + auto rowset = db.Table<Schema::RTMRPartitions>().Range().Select(); + if (!rowset.IsReady()) + return false; + + while (!rowset.EndOfSet()) { TLocalPathId localPathId = rowset.GetValue<Schema::RTMRPartitions::PathId>(); TPathId pathId(selfId, localPathId); - - auto it = Self->RtmrVolumes.find(pathId); - Y_VERIFY(it != Self->RtmrVolumes.end()); - Y_VERIFY(it->second); - - auto partitionId = rowset.GetValue<Schema::RTMRPartitions::PartitionId>(); - Y_VERIFY(partitionId.size() == sizeof(TGUID)); - - TGUID guidId; - Copy(partitionId.cbegin(), partitionId.cend(), (char*)guidId.dw); - - ui64 busKey = rowset.GetValue<Schema::RTMRPartitions::BusKey>(); + + auto it = Self->RtmrVolumes.find(pathId); + Y_VERIFY(it != Self->RtmrVolumes.end()); + Y_VERIFY(it->second); + + auto partitionId = rowset.GetValue<Schema::RTMRPartitions::PartitionId>(); + Y_VERIFY(partitionId.size() == sizeof(TGUID)); + + TGUID guidId; + Copy(partitionId.cbegin(), partitionId.cend(), (char*)guidId.dw); + + ui64 busKey = rowset.GetValue<Schema::RTMRPartitions::BusKey>(); TLocalShardIdx localShardIdx = rowset.GetValue<Schema::RTMRPartitions::ShardIdx>(); TShardIdx shardIdx = Self->MakeLocalId(localShardIdx); auto tabletId = Self->ShardInfos.at(shardIdx).TabletID; - - TRtmrPartitionInfo::TPtr partitionInfo = new TRtmrPartitionInfo(guidId, busKey, shardIdx, tabletId); - it->second->Partitions[shardIdx] = partitionInfo; - - if (!rowset.Next()) - return false; - } - } - + + TRtmrPartitionInfo::TPtr partitionInfo = new TRtmrPartitionInfo(guidId, busKey, shardIdx, tabletId); + it->second->Partitions[shardIdx] = partitionInfo; + + if (!rowset.Next()) + return false; + } + } + // Read Solomon volumes { auto rowset = db.Table<Schema::SolomonVolumes>().Range().Select(); @@ -3698,9 +3698,9 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> { case ETabletType::Mediator: Self->TabletCounters->Simple()[COUNTER_SUB_DOMAIN_MEDIATOR_COUNT].Add(1); break; - case ETabletType::RTMRPartition: - Self->TabletCounters->Simple()[COUNTER_RTMR_PARTITIONS_COUNT].Add(1); - break; + case ETabletType::RTMRPartition: + Self->TabletCounters->Simple()[COUNTER_RTMR_PARTITIONS_COUNT].Add(1); + break; case ETabletType::KeyValue: Self->TabletCounters->Simple()[COUNTER_SOLOMON_PARTITIONS_COUNT].Add(1); break; diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 0912d27468..0715543a22 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -2360,17 +2360,17 @@ void TSchemeShard::PersistRtmrVolume(NIceDb::TNiceDb &db, TPathId pathId, const Y_VERIFY(IsLocalId(pathId)); db.Table<Schema::RtmrVolumes>().Key(pathId.LocalPathId).Update( - NIceDb::TUpdate<Schema::RtmrVolumes::PartitionsCount>(rtmrVol->Partitions.size())); - - for (const auto& partition: rtmrVol->Partitions) { - TString partitionId = TString((const char*)partition.second->Id.dw, sizeof(TGUID)); - + NIceDb::TUpdate<Schema::RtmrVolumes::PartitionsCount>(rtmrVol->Partitions.size())); + + for (const auto& partition: rtmrVol->Partitions) { + TString partitionId = TString((const char*)partition.second->Id.dw, sizeof(TGUID)); + db.Table<Schema::RTMRPartitions>().Key(pathId.LocalPathId, partition.second->ShardIdx.GetLocalId()).Update( - NIceDb::TUpdate<Schema::RTMRPartitions::PartitionId>(partitionId), - NIceDb::TUpdate<Schema::RTMRPartitions::BusKey>(partition.second->BusKey)); - } -} - + NIceDb::TUpdate<Schema::RTMRPartitions::PartitionId>(partitionId), + NIceDb::TUpdate<Schema::RTMRPartitions::BusKey>(partition.second->BusKey)); + } +} + void TSchemeShard::PersistRemoveRtmrVolume(NIceDb::TNiceDb &db, TPathId pathId) { Y_VERIFY(IsLocalId(pathId)); diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.h b/ydb/core/tx/schemeshard/schemeshard_impl.h index d6746167af..e1a1d08b9a 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.h +++ b/ydb/core/tx/schemeshard/schemeshard_impl.h @@ -164,7 +164,7 @@ public: THashMap<TPathId, TTxId> LockedPaths; THashMap<TPathId, TPersQueueGroupInfo::TPtr> PersQueueGroups; - THashMap<TPathId, TRtmrVolumeInfo::TPtr> RtmrVolumes; + THashMap<TPathId, TRtmrVolumeInfo::TPtr> RtmrVolumes; THashMap<TPathId, TSolomonVolumeInfo::TPtr> SolomonVolumes; THashMap<TPathId, TSubDomainInfo::TPtr> SubDomains; THashMap<TPathId, TBlockStoreVolumeInfo::TPtr> BlockStoreVolumes; diff --git a/ydb/core/tx/schemeshard/ut_helpers/helpers.h b/ydb/core/tx/schemeshard/ut_helpers/helpers.h index 1e99d811dc..6b12c25534 100644 --- a/ydb/core/tx/schemeshard/ut_helpers/helpers.h +++ b/ydb/core/tx/schemeshard/ut_helpers/helpers.h @@ -169,14 +169,14 @@ namespace NSchemeShardUT_Private { // rtmr GENERIC_HELPERS(CreateRtmrVolume); - + // solomon GENERIC_HELPERS(CreateSolomon); GENERIC_HELPERS(AlterSolomon); GENERIC_HELPERS(DropSolomon); DROP_BY_PATH_ID_HELPERS(DropSolomon); NKikimrSchemeOp::TCreateSolomonVolume TakeTabletsFromAnotherSolomonVol(TString name, TString ls, ui32 count = 0); - + // kesus GENERIC_HELPERS(CreateKesus); GENERIC_HELPERS(AlterKesus); diff --git a/ydb/core/viewer/browse.h b/ydb/core/viewer/browse.h index 5f9eaff3f1..c5716f46a7 100644 --- a/ydb/core/viewer/browse.h +++ b/ydb/core/viewer/browse.h @@ -68,7 +68,7 @@ public: case NKikimrSchemeOp::EPathType::EPathTypeColumnStore: // TODO return NKikimrViewer::EObjectType::Directory; case NKikimrSchemeOp::EPathType::EPathTypeRtmrVolume: - return NKikimrViewer::EObjectType::RtmrVolume; + return NKikimrViewer::EObjectType::RtmrVolume; case NKikimrSchemeOp::EPathType::EPathTypeTable: case NKikimrSchemeOp::EPathType::EPathTypeColumnTable: // TODO return NKikimrViewer::EObjectType::Table; diff --git a/ydb/core/viewer/protos/viewer.proto b/ydb/core/viewer/protos/viewer.proto index 691b442218..9f6c822a89 100644 --- a/ydb/core/viewer/protos/viewer.proto +++ b/ydb/core/viewer/protos/viewer.proto @@ -25,7 +25,7 @@ enum EObjectType { RtmrOperation = 11; RtmrTasks = 12; // flat list of tasks RtmrTask = 13; // task is the group of operations, associated tables and some metadata - RtmrVolume = 14; + RtmrVolume = 14; BlockStoreVolume = 15; Kesus = 16; SolomonVolume = 17; diff --git a/ydb/public/api/protos/ya.make b/ydb/public/api/protos/ya.make index ab8387c36f..8a156403a3 100644 --- a/ydb/public/api/protos/ya.make +++ b/ydb/public/api/protos/ya.make @@ -55,7 +55,7 @@ IF (MODULE_TAG == "CPP_PROTO") GENERATE_ENUM_SERIALIZATION(ydb_persqueue_cluster_discovery.pb.h) GENERATE_ENUM_SERIALIZATION(draft/datastreams.pb.h) ENDIF() - + EXCLUDE_TAGS(GO_PROTO) END() diff --git a/ydb/public/lib/deprecated/kicli/kicli.h b/ydb/public/lib/deprecated/kicli/kicli.h index d4ae6ea51a..9dc472d231 100644 --- a/ydb/public/lib/deprecated/kicli/kicli.h +++ b/ydb/public/lib/deprecated/kicli/kicli.h @@ -570,7 +570,7 @@ public: Table, PersQueueGroup, SubDomain, - RtmrVolume, + RtmrVolume, BlockStoreVolume, Kesus, SolomonVolume, diff --git a/ydb/public/lib/deprecated/kicli/kikimr.cpp b/ydb/public/lib/deprecated/kicli/kikimr.cpp index 12067eb811..4156d72d4b 100644 --- a/ydb/public/lib/deprecated/kicli/kikimr.cpp +++ b/ydb/public/lib/deprecated/kicli/kikimr.cpp @@ -22,10 +22,10 @@ struct TRetryState { } ++RetryNumber; RetryDuration = wait; - return RetryNumber <= policy.RetryLimitCount; + return RetryNumber <= policy.RetryLimitCount; } - ui32 RetryNumber = 0; + ui32 RetryNumber = 0; TDuration RetryDuration; }; diff --git a/ydb/public/lib/deprecated/kicli/schema.cpp b/ydb/public/lib/deprecated/kicli/schema.cpp index c964a99b7a..d1ee0384f8 100644 --- a/ydb/public/lib/deprecated/kicli/schema.cpp +++ b/ydb/public/lib/deprecated/kicli/schema.cpp @@ -121,7 +121,7 @@ void TSchemaObject::Drop() { break; case EPathType::Unknown: case EPathType::SubDomain: - case EPathType::RtmrVolume: + case EPathType::RtmrVolume: throw yexception() << "Wrong drop"; break; } @@ -185,7 +185,7 @@ static TSchemaObject::EPathType GetType(const NKikimrSchemeOp::TDirEntry& entry) case NKikimrSchemeOp::EPathTypeSubDomain: return TSchemaObject::EPathType::SubDomain; case NKikimrSchemeOp::EPathTypeRtmrVolume: - return TSchemaObject::EPathType::RtmrVolume; + return TSchemaObject::EPathType::RtmrVolume; case NKikimrSchemeOp::EPathTypeBlockStoreVolume: return TSchemaObject::EPathType::BlockStoreVolume; case NKikimrSchemeOp::EPathTypeFileStore: |