aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorva-kuznecov <va-kuznecov@ydb.tech>2022-09-20 10:01:30 +0300
committerva-kuznecov <va-kuznecov@ydb.tech>2022-09-20 10:01:30 +0300
commitaac6159f005fb36cabe1d93ccc45d9fab6100c8f (patch)
treeedea6147d08af2e2ca9e30fd5081b0df52b83c00
parent438d12cd8f460b457593f0bc5b69e2b6617501cd (diff)
downloadydb-aac6159f005fb36cabe1d93ccc45d9fab6100c8f.tar.gz
Enable session_actor by TableServiceConfig (and remove feature flag)
-rw-r--r--ydb/core/kqp/proxy/kqp_proxy_service.cpp4
-rw-r--r--ydb/core/kqp/ut/common/kqp_ut_common.h7
-rw-r--r--ydb/core/kqp/ut/kqp_limits_ut.cpp10
-rw-r--r--ydb/core/kqp/ut/kqp_query_ut.cpp2
-rw-r--r--ydb/core/kqp/ut/kqp_types_arrow_ut.cpp8
-rw-r--r--ydb/core/protos/config.proto3
-rw-r--r--ydb/core/testlib/basics/feature_flags.h2
-rw-r--r--ydb/core/testlib/test_client.h5
8 files changed, 31 insertions, 10 deletions
diff --git a/ydb/core/kqp/proxy/kqp_proxy_service.cpp b/ydb/core/kqp/proxy/kqp_proxy_service.cpp
index 2e198a3d4f..0fb49de196 100644
--- a/ydb/core/kqp/proxy/kqp_proxy_service.cpp
+++ b/ydb/core/kqp/proxy/kqp_proxy_service.cpp
@@ -886,7 +886,7 @@ public:
str << Endl;
str << "EnableSessionActor: "
- << (AppData()->FeatureFlags.GetEnableKqpSessionActor() ? "true" : "false") << Endl;
+ << (TableServiceConfig.GetEnableKqpSessionActor() ? "true" : "false") << Endl;
str << "Active workers/session_actors count on node: " << LocalSessions->size() << Endl;
const auto& sessionsShutdownInFlight = LocalSessions->GetShutdownInFlight();
@@ -1153,7 +1153,7 @@ private:
auto config = CreateConfig(KqpSettings, workerSettings);
- IActor* workerActor = AppData()->FeatureFlags.GetEnableKqpSessionActor() && config->HasKqpForceNewEngine()
+ IActor* workerActor = TableServiceConfig.GetEnableKqpSessionActor() && config->HasKqpForceNewEngine()
? CreateKqpSessionActor(SelfId(), sessionId, KqpSettings, workerSettings, ModuleResolverState, Counters)
: CreateKqpWorkerActor(SelfId(), sessionId, KqpSettings, workerSettings, ModuleResolverState, Counters);
auto workerId = TlsActivationContext->ExecutorThread.RegisterActor(workerActor, TMailboxType::HTSwap, AppData()->UserPoolId);
diff --git a/ydb/core/kqp/ut/common/kqp_ut_common.h b/ydb/core/kqp/ut/common/kqp_ut_common.h
index b1b8a33996..cf4a95efef 100644
--- a/ydb/core/kqp/ut/common/kqp_ut_common.h
+++ b/ydb/core/kqp/ut/common/kqp_ut_common.h
@@ -86,10 +86,15 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder<TKikimrSettings> {
TKikimrSettings()
{
// default value for tests, can be overwritten by SetFeatureFlags()
- this->SetEnableKqpSessionActor(false);
+ SetEnableKqpSessionActor(false);
this->SetEnableKqpScanQueryStreamLookup(true);
}
+ TKikimrSettings& SetEnableKqpSessionActor(bool enable) {
+ AppConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(enable);
+ return *this;
+ }
+
TKikimrSettings& SetAppConfig(const NKikimrConfig::TAppConfig& value) { AppConfig = value; return *this; }
TKikimrSettings& SetFeatureFlags(const NKikimrConfig::TFeatureFlags& value) { FeatureFlags = value; return *this; }
TKikimrSettings& SetPQConfig(const NKikimrPQ::TPQConfig& value) { PQConfig = value; return *this; };
diff --git a/ydb/core/kqp/ut/kqp_limits_ut.cpp b/ydb/core/kqp/ut/kqp_limits_ut.cpp
index fc7c3845cf..92051e9e0b 100644
--- a/ydb/core/kqp/ut/kqp_limits_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_limits_ut.cpp
@@ -66,6 +66,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
Y_UNIT_TEST_NEW_ENGINE(DatashardProgramSize) {
auto app = NKikimrConfig::TAppConfig();
app.MutableTableServiceConfig()->MutableResourceManager()->SetMkqlLightProgramMemoryLimit(1'000'000'000);
+ app.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(app);
CreateLargeTable(kikimr, 0, 0, 0);
@@ -110,6 +111,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
auto app = NKikimrConfig::TAppConfig();
auto& queryLimits = *app.MutableTableServiceConfig()->MutableQueryLimits();
queryLimits.MutablePhaseLimits()->SetComputeNodeMemoryLimitBytes(1'000'000'000);
+ app.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(app);
CreateLargeTable(kikimr, 100, 10, 1'000'000, 1, 2);
@@ -147,6 +149,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
auto app = NKikimrConfig::TAppConfig();
app.MutableTableServiceConfig()->MutableResourceManager()->SetMkqlLightProgramMemoryLimit(1'000'000'000);
app.MutableTableServiceConfig()->SetCompileTimeoutMs(TDuration::Minutes(5).MilliSeconds());
+ app.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(app);
CreateLargeTable(kikimr, 0, 0, 0);
@@ -290,6 +293,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
NKikimrConfig::TAppConfig appConfig;
auto& queryLimits = *appConfig.MutableTableServiceConfig()->MutableQueryLimits();
queryLimits.MutablePhaseLimits()->SetAffectedShardsLimit(20);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(appConfig);
@@ -336,6 +340,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
NKikimrConfig::TAppConfig appConfig;
auto& queryLimits = *appConfig.MutableTableServiceConfig()->MutableQueryLimits();
queryLimits.MutablePhaseLimits()->SetReadsetCountLimit(50);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(appConfig);
CreateLargeTable(kikimr, 10, 10, 100);
@@ -370,7 +375,8 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
- .SetEnableMvccSnapshotReads(false);
+ .SetEnableMvccSnapshotReads(false)
+ .SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(serverSettings);
CreateLargeTable(kikimr, 20, 10, 1'000'000, 1);
@@ -411,6 +417,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
appConfig.MutableTableServiceConfig()->MutableResourceManager()->SetMkqlLightProgramMemoryLimit(1'000'000'000);
auto& queryLimits = *appConfig.MutableTableServiceConfig()->MutableQueryLimits();
queryLimits.MutablePhaseLimits()->SetComputeNodeMemoryLimitBytes(100'000'000);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(appConfig);
@@ -462,6 +469,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
Y_UNIT_TEST_NEW_ENGINE(QueryExecTimeout) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->MutableResourceManager()->SetMkqlLightProgramMemoryLimit(10'000'000'000);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(false);
TKikimrRunner kikimr(appConfig);
diff --git a/ydb/core/kqp/ut/kqp_query_ut.cpp b/ydb/core/kqp/ut/kqp_query_ut.cpp
index e59822a4ad..9952be2fe9 100644
--- a/ydb/core/kqp/ut/kqp_query_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_query_ut.cpp
@@ -86,6 +86,7 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
Y_UNIT_TEST_NEW_ENGINE(QueryCacheTtl) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetCompileQueryCacheTTLSec(2);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(UseNewEngine);
TKikimrRunner kikimr(appConfig);
auto db = kikimr.GetTableClient();
@@ -963,6 +964,7 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->MutableQueryLimits()->SetResultRowsLimit(6);
+ appConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(UseNewEngine);
TKikimrRunner kikimr(appConfig, {setting});
auto db = kikimr.GetTableClient();
diff --git a/ydb/core/kqp/ut/kqp_types_arrow_ut.cpp b/ydb/core/kqp/ut/kqp_types_arrow_ut.cpp
index 937c84806e..96e9a0bbfc 100644
--- a/ydb/core/kqp/ut/kqp_types_arrow_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_types_arrow_ut.cpp
@@ -11,11 +11,11 @@ using namespace NYdb::NTable;
namespace {
TKikimrRunner RunnerWithArrowFormatEnabled() {
- NKikimrConfig::TFeatureFlags featureFlags;
- featureFlags.SetEnableArrowFormatAtDatashard(true);
- featureFlags.SetEnableKqpSessionActor(true);
+ auto settings = TKikimrSettings()
+ .SetEnableArrowFormatAtDatashard(true)
+ .SetEnableKqpSessionActor(true);
- return TKikimrRunner{featureFlags};
+ return TKikimrRunner{settings};
}
void InsertAllColumnsAndCheckSelectAll(TKikimrRunner* runner) {
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index 5f360946ca..68b84ff8ef 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -697,7 +697,7 @@ message TFeatureFlags {
optional bool EnableTtlOnAsyncIndexedTables = 55 [default = true];
optional bool EnableBulkUpsertToAsyncIndexedTables = 56 [default = true];
optional bool EnableNodeBrokerSingleDomainMode = 57 [default = true];
- optional bool EnableKqpSessionActor = 58 [default = true];
+ reserved 58; // optional bool EnableKqpSessionActor = 58 [default = true];
// Dangerous settings we don't want in the public api unless required
optional bool EnablePublicApiExternalBlobs = 59 [default = false];
optional bool EnablePublicApiKeepInMemory = 60 [default = false];
@@ -1166,6 +1166,7 @@ message TTableServiceConfig {
optional uint32 ForceNewEngineLevel = 22 [default = 0];
optional uint32 CompileQueryCacheTTLSec = 20 [default = 0];
optional TQueryReplayConfig QueryReplayConfig = 21;
+ optional bool EnableKqpSessionActor = 23 [default = true];
};
// Config describes immediate controls and allows
diff --git a/ydb/core/testlib/basics/feature_flags.h b/ydb/core/testlib/basics/feature_flags.h
index c12bb5657d..c512e2b508 100644
--- a/ydb/core/testlib/basics/feature_flags.h
+++ b/ydb/core/testlib/basics/feature_flags.h
@@ -34,11 +34,11 @@ public:
FEATURE_FLAG_SETTER(EnableTtlOnAsyncIndexedTables)
FEATURE_FLAG_SETTER(EnableBulkUpsertToAsyncIndexedTables)
FEATURE_FLAG_SETTER(EnableChangefeeds)
- FEATURE_FLAG_SETTER(EnableKqpSessionActor)
FEATURE_FLAG_SETTER(EnableKqpScanQueryStreamLookup)
FEATURE_FLAG_SETTER(EnableMoveIndex)
FEATURE_FLAG_SETTER(EnablePredicateExtractForDataQueries)
FEATURE_FLAG_SETTER(EnableNotNullDataColumns)
+ FEATURE_FLAG_SETTER(EnableArrowFormatAtDatashard)
TDerived& SetEnableMvcc(std::optional<bool> value) {
if (value) {
diff --git a/ydb/core/testlib/test_client.h b/ydb/core/testlib/test_client.h
index fe86c76f27..9326e9718f 100644
--- a/ydb/core/testlib/test_client.h
+++ b/ydb/core/testlib/test_client.h
@@ -133,6 +133,11 @@ namespace Tests {
std::function<IActor*(const NKikimrProto::TAuthConfig&)> CreateTicketParser = NKikimr::CreateTicketParser;
std::shared_ptr<TGrpcServiceFactory> GrpcServiceFactory;
+ TServerSettings& SetEnableKqpSessionActor(bool enable) {
+ AppConfig.MutableTableServiceConfig()->SetEnableKqpSessionActor(enable);
+ return *this;
+ }
+
TServerSettings& SetGrpcPort(ui16 value) { GrpcPort = value; return *this; }
TServerSettings& SetSupportsRedirect(bool value) { SupportsRedirect = value; return *this; }
TServerSettings& SetTracePath(const TString& value) { TracePath = value; return *this; }