diff options
author | Aleksandr Petrikhin <shmeleine@gmail.com> | 2022-05-19 20:30:24 +0300 |
---|---|---|
committer | Aleksandr Petrikhin <shmeleine@gmail.com> | 2022-05-19 20:30:24 +0300 |
commit | fca1de64c46a64296254b2910846fc3da50f0e4c (patch) | |
tree | 6aa0fb04f348ab1b6522bfc2db76ee3dc842c61b | |
parent | 24a1a8c84b57622e7b65fdc43b54ca6f718b6515 (diff) | |
download | ydb-fca1de64c46a64296254b2910846fc3da50f0e4c.tar.gz |
[KIKIMR-14221] change pq config defaults
ref:76518c1cd41d3da93cb5e721d0b8770e7c77dd5d
-rw-r--r-- | ydb/core/client/server/msgbus_server_pq_metarequest_ut.cpp | 7 | ||||
-rw-r--r-- | ydb/core/persqueue/pq_ut.h | 33 | ||||
-rw-r--r-- | ydb/core/protos/pqconfig.proto | 20 | ||||
-rw-r--r-- | ydb/core/tablet/tablet_counters_aggregator_ut.cpp | 3 | ||||
-rw-r--r-- | ydb/core/testlib/test_pq_client.h | 10 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_change_collector.cpp | 4 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_change_exchange.cpp | 3 | ||||
-rw-r--r-- | ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h | 9 | ||||
-rw-r--r-- | ydb/services/datastreams/datastreams_ut.cpp | 4 | ||||
-rw-r--r-- | ydb/tests/library/harness/kikimr_config.py | 1 | ||||
-rw-r--r-- | ydb/tests/library/harness/resources/default_yaml.yml | 10 |
11 files changed, 89 insertions, 15 deletions
diff --git a/ydb/core/client/server/msgbus_server_pq_metarequest_ut.cpp b/ydb/core/client/server/msgbus_server_pq_metarequest_ut.cpp index b064b0f54d..b4a37319af 100644 --- a/ydb/core/client/server/msgbus_server_pq_metarequest_ut.cpp +++ b/ydb/core/client/server/msgbus_server_pq_metarequest_ut.cpp @@ -59,6 +59,13 @@ protected: // Logging Runtime->SetLogPriority(NKikimrServices::PERSQUEUE, NLog::PRI_DEBUG); Runtime->GetAppData(0).PQConfig.SetEnabled(true); + + // NOTE(shmel1k@): KIKIMR-14221 + Runtime->GetAppData(0).PQConfig.SetTopicsAreFirstClassCitizen(false); + Runtime->GetAppData(0).PQConfig.SetRequireCredentialsInNewProtocol(false); + Runtime->GetAppData(0).PQConfig.SetClusterTablePath("/Root/PQ/Config/V2/Cluster"); + Runtime->GetAppData(0).PQConfig.SetVersionTablePath("/Root/PQ/Config/V2/Versions"); + Runtime->GetAppData(0).PQConfig.SetRoot("/Root/PQ"); } void TearDown() override { diff --git a/ydb/core/persqueue/pq_ut.h b/ydb/core/persqueue/pq_ut.h index cd0c1c57cf..3226115a67 100644 --- a/ydb/core/persqueue/pq_ut.h +++ b/ydb/core/persqueue/pq_ut.h @@ -148,6 +148,14 @@ struct TTestContext { TDispatchOptions options; options.FinalEvents.push_back(TDispatchOptions::TFinalEventCondition(TEvTablet::EvBoot)); Runtime->GetAppData(0).PQConfig.SetEnabled(true); + // NOTE(shmel1k@): KIKIMR-14221 + Runtime->GetAppData(0).PQConfig.SetTopicsAreFirstClassCitizen(false); + Runtime->GetAppData(0).PQConfig.SetRequireCredentialsInNewProtocol(false); + Runtime->GetAppData(0).PQConfig.SetClusterTablePath("/Root/PQ/Config/V2/Cluster"); + Runtime->GetAppData(0).PQConfig.SetVersionTablePath("/Root/PQ/Config/V2/Versions"); + Runtime->GetAppData(0).PQConfig.SetTopicsAreFirstClassCitizen(false); + Runtime->GetAppData(0).PQConfig.SetRoot("/Root/PQ"); + Runtime->GetAppData(0).PQConfig.MutableQuotingConfig()->SetEnableQuoting(false); Runtime->DispatchEvents(options); @@ -213,7 +221,20 @@ struct TFinalizer { // SINGLE COMMAND TEST FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void PQTabletPrepare(ui32 mcip, ui64 msip, i32 deleteTime, const TVector<std::pair<TString, bool>>& users, TTestContext& tc, int partitions = 2, ui32 lw = 6_MB, bool localDC = true, ui64 ts = 0, ui64 sidMaxCount = 0, ui32 specVersion = 0, i32 storageLimitBytes = 0) { +void PQTabletPrepare( + ui32 mcip, + ui64 msip, + ui32 deleteTime, + const TVector<std::pair<TString, bool>>& users, + TTestContext& tc, + int partitions = 2, + ui32 lw = 6_MB, + bool localDC = true, + ui64 ts = 0, + ui64 sidMaxCount = 0, + ui32 specVersion = 0, + i32 storageLimitBytes = 0 + ) { TAutoPtr<IEventHandle> handle; static int version = 0; if (specVersion) { @@ -232,7 +253,13 @@ void PQTabletPrepare(ui32 mcip, ui64 msip, i32 deleteTime, const TVector<std::pa request->Record.MutableTabletConfig()->SetCacheSize(10_MB); request->Record.SetTxId(12345); auto tabletConfig = request->Record.MutableTabletConfig(); - tabletConfig->SetTopicName("rt3.dc1--topic"); + if (tc.Runtime->GetAppData().PQConfig.GetTopicsAreFirstClassCitizen()) { + tabletConfig->SetTopicName("topic"); + tabletConfig->SetTopicPath(tc.Runtime->GetAppData().PQConfig.GetDatabase() + "/topic"); + } else { + tabletConfig->SetTopicName("rt3.dc1--topic"); + tabletConfig->SetTopicPath("/Root/PQ/rt3.dc1--topic"); + } tabletConfig->SetTopic("topic"); tabletConfig->SetVersion(version); tabletConfig->SetLocalDC(localDC); @@ -254,7 +281,7 @@ void PQTabletPrepare(ui32 mcip, ui64 msip, i32 deleteTime, const TVector<std::pa for (auto& u : users) { if (u.second) - config->AddImportantClientId(u.first); + config->AddImportantClientId(u.first); if (u.first != "user") tabletConfig->AddReadRules(u.first); } diff --git a/ydb/core/protos/pqconfig.proto b/ydb/core/protos/pqconfig.proto index 6141d169df..0e52801469 100644 --- a/ydb/core/protos/pqconfig.proto +++ b/ydb/core/protos/pqconfig.proto @@ -27,13 +27,13 @@ message TPQConfig { optional uint32 MaxBlobSize = 4 [default = 8388608]; //8mb optional uint32 ClustersUpdateTimeoutSec = 5 [default = 30]; - optional bool Enabled = 6 [default = false]; // Enable PQ proxies + optional bool Enabled = 6 [default = true]; // Enable PQ proxies optional uint32 MetaCacheTimeoutSec = 7 [default = 30, deprecated = true]; optional uint32 MaxReadCookies = 8 [default = 100000]; - optional bool CheckACL = 9 [default = false]; + optional bool CheckACL = 9 [default = true]; optional uint32 SourceIdCleanupPeriodSec = 10 [default = 60]; // 24 hours // TODO: What is '24 hours'? Default is 60 seconds. optional uint32 SourceIdMaxLifetimeSec = 11 [default = 1382400]; // 16 days @@ -41,10 +41,10 @@ message TPQConfig { optional NKikimrClient.TKeyValueRequest.ETactic Tactic = 13 [default = MAX_THROUGHPUT]; - optional bool RequireCredentialsInNewProtocol = 14 [default = false]; + optional bool RequireCredentialsInNewProtocol = 14 [default = true]; - optional string ClusterTablePath = 15 [default = "/Root/PQ/Config/V2/Cluster"]; - optional string VersionTablePath = 16 [default = "/Root/PQ/Config/V2/Versions"]; + optional string ClusterTablePath = 15 [default = ""]; + optional string VersionTablePath = 16 [default = ""]; optional uint32 ClustersUpdateTimeoutOnErrorSec = 17 [default = 1]; @@ -57,9 +57,9 @@ message TPQConfig { message TQuotingConfig { - optional bool EnableQuoting = 1; - optional string QuotersDirectoryPath = 2 [default = "/Root/PersQueue/System/Quoters"]; - optional ELimitedEntity TopicWriteQuotaEntityToLimit = 3; + optional bool EnableQuoting = 1 [default = true]; + optional string QuotersDirectoryPath = 2 [default = ""]; + optional ELimitedEntity TopicWriteQuotaEntityToLimit = 3 [default = USER_PAYLOAD_SIZE]; // Enum for describing entities that quoter can limit. enum ELimitedEntity { @@ -83,7 +83,7 @@ message TPQConfig { optional bool RoundRobinPartitionMapping = 26 [default = true]; - optional string Root = 27 [default = "/Root/PQ"]; + optional string Root = 27 [default = ""]; optional string TestDatabaseRoot = 47; // For unit-tests only message TPQLibSettings { @@ -103,7 +103,7 @@ message TPQConfig { repeated TChannelProfile ChannelProfiles = 31; - optional bool TopicsAreFirstClassCitizen = 32 [default = false]; + optional bool TopicsAreFirstClassCitizen = 32 [default = true]; optional string SourceIdTablePath = 33 [default = "/Root/PQ/SourceIdMeta2"]; diff --git a/ydb/core/tablet/tablet_counters_aggregator_ut.cpp b/ydb/core/tablet/tablet_counters_aggregator_ut.cpp index b73a410612..b1c9026742 100644 --- a/ydb/core/tablet/tablet_counters_aggregator_ut.cpp +++ b/ydb/core/tablet/tablet_counters_aggregator_ut.cpp @@ -752,6 +752,9 @@ Y_UNIT_TEST_SUITE(TTabletLabeledCountersAggregator) { TTestBasicRuntime runtime(1); runtime.Initialize(TAppPrepare().Unwrap()); + // NOTE(shmel1k@): KIKIMR-14221 + runtime.GetAppData().PQConfig.SetTopicsAreFirstClassCitizen(false); + TActorId edge = runtime.AllocateEdgeActor(); IActor* aggregator = CreateClusterLabeledCountersAggregatorActor(edge, TTabletTypes::PersQueue, 3, "rt3.*--*,cons*/*/rt.*--*", 3); diff --git a/ydb/core/testlib/test_pq_client.h b/ydb/core/testlib/test_pq_client.h index 41ad853d53..57d59cfcb9 100644 --- a/ydb/core/testlib/test_pq_client.h +++ b/ydb/core/testlib/test_pq_client.h @@ -31,10 +31,18 @@ inline Tests::TServerSettings PQSettings(ui16 port, ui32 nodesCount = 2, bool ro authConfig.SetUseAccessServiceTLS(false); authConfig.SetUseStaff(false); pqConfig.SetRoundRobinPartitionMapping(roundrobin); - pqConfig.SetTopicsAreFirstClassCitizen(false); pqConfig.SetEnabled(true); pqConfig.SetMaxReadCookies(10); + + // NOTE(shmel1k@): KIKIMR-14221 + pqConfig.SetRequireCredentialsInNewProtocol(false); + pqConfig.SetClusterTablePath("/Root/PQ/Config/V2/Cluster"); + pqConfig.SetVersionTablePath("/Root/PQ/Config/V2/Versions"); + pqConfig.SetTopicsAreFirstClassCitizen(false); + pqConfig.SetRoot("/Root/PQ"); + pqConfig.MutableQuotingConfig()->SetEnableQuoting(false); + for (int i = 0; i < 12; ++i) { auto profile = pqConfig.AddChannelProfiles(); Y_UNUSED(profile); diff --git a/ydb/core/tx/datashard/datashard_ut_change_collector.cpp b/ydb/core/tx/datashard/datashard_ut_change_collector.cpp index 94ad557643..7d815dd8a1 100644 --- a/ydb/core/tx/datashard/datashard_ut_change_collector.cpp +++ b/ydb/core/tx/datashard/datashard_ut_change_collector.cpp @@ -564,6 +564,10 @@ Y_UNIT_TEST_SUITE(CdcStreamChangeCollector) { NKikimrPQ::TPQConfig pqConfig; pqConfig.SetEnableProtoSourceIdInfo(true); pqConfig.SetTopicsAreFirstClassCitizen(true); + // NOTE(shmel1k@): KIKIMR-14221 + pqConfig.SetCheckACL(false); + pqConfig.SetRequireCredentialsInNewProtocol(false); + pqConfig.MutableQuotingConfig()->SetEnableQuoting(false); return pqConfig; } diff --git a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp index 9a2d721607..850e526c85 100644 --- a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp +++ b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp @@ -743,6 +743,9 @@ Y_UNIT_TEST_SUITE(Cdc) { pqConfig.SetTopicsAreFirstClassCitizen(true); pqConfig.SetMaxReadCookies(10); pqConfig.AddClientServiceType()->SetName("data-streams"); + pqConfig.SetCheckACL(false); + pqConfig.SetRequireCredentialsInNewProtocol(false); + pqConfig.MutableQuotingConfig()->SetEnableQuoting(false); return pqConfig; } diff --git a/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h b/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h index 677eb8c03d..f83f7a604f 100644 --- a/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h +++ b/ydb/public/sdk/cpp/client/ydb_persqueue_core/ut/ut_utils/sdk_test_setup.h @@ -42,6 +42,15 @@ public: Server.ServerSettings.PQConfig.SetRemoteClusterEnabledDelaySec(1); Server.ServerSettings.PQConfig.SetCloseClientSessionWithEnabledRemotePreferredClusterDelaySec(1); Server.ServerSettings.PQClusterDiscoveryConfig.SetEnabled(true); + // NOTE(shmel1k@): KIKIMR-14221 + Server.ServerSettings.PQConfig.SetCheckACL(false); + Server.ServerSettings.PQConfig.SetRequireCredentialsInNewProtocol(false); + Server.ServerSettings.PQConfig.SetClusterTablePath("/Root/PQ/Config/V2/Cluster"); + Server.ServerSettings.PQConfig.SetVersionTablePath("/Root/PQ/Config/V2/Versions"); + Server.ServerSettings.PQConfig.SetTopicsAreFirstClassCitizen(false); + Server.ServerSettings.PQConfig.SetRoot("/Root/PQ"); + Server.ServerSettings.PQConfig.MutableQuotingConfig()->SetEnableQuoting(false); + SetNetDataViaFile("::1/128\t" + GetLocalCluster()); auto seed = TInstant::Now().MicroSeconds(); diff --git a/ydb/services/datastreams/datastreams_ut.cpp b/ydb/services/datastreams/datastreams_ut.cpp index 6f926a946f..8d5f7cdeac 100644 --- a/ydb/services/datastreams/datastreams_ut.cpp +++ b/ydb/services/datastreams/datastreams_ut.cpp @@ -42,6 +42,10 @@ public: NKikimrConfig::TAppConfig appConfig; appConfig.MutablePQConfig()->SetTopicsAreFirstClassCitizen(true); appConfig.MutablePQConfig()->SetEnabled(true); + // NOTE(shmel1k@): KIKIMR-14221 + appConfig.MutablePQConfig()->SetCheckACL(false); + appConfig.MutablePQConfig()->SetRequireCredentialsInNewProtocol(false); + appConfig.MutablePQConfig()->MutableQuotingConfig()->SetEnableQuoting(true); appConfig.MutablePQConfig()->MutableQuotingConfig()->SetQuotaWaitDurationMs(300); appConfig.MutablePQConfig()->MutableQuotingConfig()->SetPartitionReadQuotaIsTwiceWriteQuota(true); diff --git a/ydb/tests/library/harness/kikimr_config.py b/ydb/tests/library/harness/kikimr_config.py index f9b0f981f0..e42503fc47 100644 --- a/ydb/tests/library/harness/kikimr_config.py +++ b/ydb/tests/library/harness/kikimr_config.py @@ -199,6 +199,7 @@ class KikimrConfigGenerator(object): for service_type in pq_client_service_types: self.yaml_config['pqconfig']['client_service_type'].append({'name': service_type}) + # NOTE(shmel1k@): change to 'true' after migration to YDS scheme self.yaml_config['pqconfig']['topics_are_first_class_citizen'] = enable_pq and enable_datastreams self.yaml_config['sqs_config']['enable_sqs'] = enable_sqs self.yaml_config['pqcluster_discovery_config']['enabled'] = enable_pqcd diff --git a/ydb/tests/library/harness/resources/default_yaml.yml b/ydb/tests/library/harness/resources/default_yaml.yml index 149aeda3ec..af8bf137de 100644 --- a/ydb/tests/library/harness/resources/default_yaml.yml +++ b/ydb/tests/library/harness/resources/default_yaml.yml @@ -176,9 +176,17 @@ sqs_config: enable_dead_letter_queues: True pqconfig: clusters_update_timeout_sec: 1 - enabled: false + # NOTE(shmel1k@): KIKIMR-14221 + enabled: true meta_cache_timeout_sec: 1 topics_are_first_class_citizen: false + check_acl: false + require_credentials_in_new_protocol: false + cluster_table_path: "/Root/PQ/Config/V2/Cluster" + version_table_path: "/Root/PQ/Config/V2/Versions" + root: "/Root/PQ" + quoting_config: + enable_quoting: false pqcluster_discovery_config: enabled: false net_classifier_config: |