aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorilnaz <ilnaz@ydb.tech>2022-10-04 16:06:44 +0300
committerilnaz <ilnaz@ydb.tech>2022-10-04 16:06:44 +0300
commit583e10b646c2ab2eafe33de84e545df135b4be9f (patch)
treef0d1f086a771e0f41f5ca3f56bf47d5d22cc6310
parent1f20570bc068009e92714963832ba05106ddbf39 (diff)
downloadydb-583e10b646c2ab2eafe33de84e545df135b4be9f.tar.gz
Get rid of EnableAsyncIndexes
-rw-r--r--ydb/core/grpc_services/rpc_alter_table.cpp12
-rw-r--r--ydb/core/kqp/ut/kqp_indexes_ut.cpp34
-rw-r--r--ydb/core/kqp/ut/kqp_scheme_ut.cpp20
-rw-r--r--ydb/core/protos/config.proto2
-rw-r--r--ydb/core/testlib/basics/feature_flags.h1
-rw-r--r--ydb/core/tx/datashard/datashard_ut_change_collector.cpp4
-rw-r--r--ydb/core/tx/datashard/datashard_ut_change_exchange.cpp21
-rw-r--r--ydb/core/tx/datashard/datashard_ut_erase_rows.cpp3
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_indexed_table.cpp5
-rw-r--r--ydb/core/tx/schemeshard/schemeshard_build_index__create.cpp16
-rw-r--r--ydb/core/tx/schemeshard/schemeshard_impl.cpp4
-rw-r--r--ydb/core/tx/schemeshard/schemeshard_impl.h1
-rw-r--r--ydb/core/tx/schemeshard/ut_async_index.cpp46
-rw-r--r--ydb/core/tx/schemeshard/ut_base.cpp6
-rw-r--r--ydb/core/tx/schemeshard/ut_helpers/test_env.cpp2
-rw-r--r--ydb/core/tx/schemeshard/ut_helpers/test_env.h1
-rw-r--r--ydb/core/tx/schemeshard/ut_move.cpp47
-rw-r--r--ydb/core/tx/schemeshard/ut_ttl.cpp3
-rw-r--r--ydb/core/ydb_convert/table_description.cpp4
-rw-r--r--ydb/services/ydb/ydb_common_ut.h1
20 files changed, 43 insertions, 190 deletions
diff --git a/ydb/core/grpc_services/rpc_alter_table.cpp b/ydb/core/grpc_services/rpc_alter_table.cpp
index 20206719c92..45441a567bd 100644
--- a/ydb/core/grpc_services/rpc_alter_table.cpp
+++ b/ydb/core/grpc_services/rpc_alter_table.cpp
@@ -65,18 +65,6 @@ static std::pair<StatusIds::StatusCode, TString> CheckAddIndexDesc(const Ydb::Ta
return {StatusIds::UNSUPPORTED, "Data column feature is not supported yet"};
}
- switch (desc.type_case()) {
- case Table::TableIndex::kGlobalIndex:
- break;
- case Table::TableIndex::kGlobalAsyncIndex:
- if (!AppData()->FeatureFlags.GetEnableAsyncIndexes()) {
- return {StatusIds::UNSUPPORTED, "Async indexes are not supported yet"};
- }
- break;
- default:
- break;
- }
-
return {StatusIds::SUCCESS, ""};
}
diff --git a/ydb/core/kqp/ut/kqp_indexes_ut.cpp b/ydb/core/kqp/ut/kqp_indexes_ut.cpp
index 41a928c16fd..8894387d8e9 100644
--- a/ydb/core/kqp/ut/kqp_indexes_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_indexes_ut.cpp
@@ -3865,7 +3865,7 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
}
template <bool UseNewEngine>
- void CreateTableWithIndexSQL(EIndexTypeSql type, bool enableAsyncIndexes = false) {
+ void CreateTableWithIndexSQL(EIndexTypeSql type) {
auto kqpSetting = NKikimrKqp::TKqpSetting();
kqpSetting.SetName("_KqpYqlSyntaxVersion");
kqpSetting.SetValue("1");
@@ -3873,17 +3873,12 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
auto settings = TKikimrSettings()
.SetEnableMvcc(true)
.SetEnableMvccSnapshotReads(true)
- .SetEnableAsyncIndexes(enableAsyncIndexes)
.SetKqpSettings({kqpSetting});
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
const auto typeStr = IndexTypeSqlString(type);
- const auto expectedStatus = (type == EIndexTypeSql::GlobalAsync)
- ? (enableAsyncIndexes ? EStatus::SUCCESS : EStatus::GENERIC_ERROR)
- : EStatus::SUCCESS;
-
const TString createTableSql = Sprintf("CREATE TABLE `/Root/TestTable` ("
" Key Int32, IndexA Int32, IndexB Int32, IndexC String, Value String,"
" PRIMARY KEY (Key),"
@@ -3893,7 +3888,7 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
{
auto result = session.ExecuteSchemeQuery(createTableSql).GetValueSync();
UNIT_ASSERT_VALUES_EQUAL(result.IsTransportError(), false);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), expectedStatus);
+ UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::SUCCESS);
}
// Multiple create table requests with same scheme should be OK
@@ -3901,11 +3896,7 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
auto result = session.ExecuteSchemeQuery(createTableSql).GetValueSync();
UNIT_ASSERT_VALUES_EQUAL(result.IsTransportError(), false);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), expectedStatus);
- }
-
- if (type == EIndexTypeSql::GlobalAsync && !enableAsyncIndexes) {
- return;
+ UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::SUCCESS);
}
// Check we can use index (metadata is correct)
@@ -3937,20 +3928,12 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
{
const TString indexImplTable = "/Root/TestTable/SecondaryIndex1/indexImplTable";
const TString expected = R"([[[11];[111];[1]];[[22];[222];[2]];[[33];[333];[3]]])";
- if (!enableAsyncIndexes) {
- UNIT_ASSERT_VALUES_EQUAL(ReadTablePartToYson(session, indexImplTable), expected);
- } else {
- waitForAsyncIndexContent(indexImplTable, expected);
- }
+ waitForAsyncIndexContent(indexImplTable, expected);
}
{
const TString indexImplTable = "/Root/TestTable/SecondaryIndex2/indexImplTable";
const TString expected = R"([[["a"];[1]];[["b"];[2]];[["c"];[3]]])";
- if (!enableAsyncIndexes) {
- UNIT_ASSERT_VALUES_EQUAL(ReadTablePartToYson(session, indexImplTable), expected);
- } else {
- waitForAsyncIndexContent(indexImplTable, expected);
- }
+ waitForAsyncIndexContent(indexImplTable, expected);
}
}
@@ -3962,14 +3945,10 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
CreateTableWithIndexSQL<UseNewEngine>(EIndexTypeSql::GlobalSync);
}
- Y_UNIT_TEST_TWIN(CreateTableWithAsyncIndexSQLShouldFail, UseNewEngine) {
+ Y_UNIT_TEST_TWIN(CreateTableWithExplicitAsyncIndexSQL, UseNewEngine) {
CreateTableWithIndexSQL<UseNewEngine>(EIndexTypeSql::GlobalAsync);
}
- Y_UNIT_TEST_TWIN(CreateTableWithAsyncIndexSQLShouldSucceed, UseNewEngine) {
- CreateTableWithIndexSQL<UseNewEngine>(EIndexTypeSql::GlobalAsync, true);
- }
-
template <bool UseNewEngine>
void SelectFromAsyncIndexedTable() {
auto kqpSetting = NKikimrKqp::TKqpSetting();
@@ -3979,7 +3958,6 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
auto settings = TKikimrSettings()
.SetEnableMvcc(true)
.SetEnableMvccSnapshotReads(true)
- .SetEnableAsyncIndexes(true)
.SetKqpSettings({kqpSetting});
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
diff --git a/ydb/core/kqp/ut/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/kqp_scheme_ut.cpp
index 424397379fb..174b6427154 100644
--- a/ydb/core/kqp/ut/kqp_scheme_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_scheme_ut.cpp
@@ -2121,23 +2121,20 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
}
}
- void AlterTableAddIndex(EIndexTypeSql type, bool enableAsyncIndexes = false) {
- TKikimrRunner kikimr(TKikimrSettings().SetEnableAsyncIndexes(enableAsyncIndexes));
+ void AlterTableAddIndex(EIndexTypeSql type) {
+ TKikimrRunner kikimr;
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
CreateSampleTablesWithIndex(session);
const auto typeStr = IndexTypeSqlString(type);
- const auto expectedStatus = (type == EIndexTypeSql::GlobalAsync)
- ? (enableAsyncIndexes ? EStatus::SUCCESS : EStatus::UNSUPPORTED)
- : EStatus::SUCCESS;
{
auto status = session.ExecuteSchemeQuery(Sprintf(R"(
--!syntax_v1
ALTER TABLE `/Root/Test` ADD INDEX NameIndex %s ON (Name);
)", typeStr.data())).ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL_C(status.GetStatus(), expectedStatus, status.GetIssues().ToString());
+ UNIT_ASSERT_VALUES_EQUAL_C(status.GetStatus(), EStatus::SUCCESS, status.GetIssues().ToString());
}
{
@@ -2145,11 +2142,6 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
UNIT_ASSERT_EQUAL(describe.GetStatus(), EStatus::SUCCESS);
auto indexDesc = describe.GetTableDescription().GetIndexDescriptions();
- if (expectedStatus != EStatus::SUCCESS) {
- UNIT_ASSERT_VALUES_EQUAL(indexDesc.size(), 0);
- return;
- }
-
UNIT_ASSERT_VALUES_EQUAL(indexDesc.size(), 1);
UNIT_ASSERT_VALUES_EQUAL(indexDesc.back().GetIndexName(), "NameIndex");
UNIT_ASSERT_VALUES_EQUAL(indexDesc.back().GetIndexType(), IndexTypeSqlToIndexType(type));
@@ -2200,14 +2192,10 @@ Y_UNIT_TEST_SUITE(KqpScheme) {
AlterTableAddIndex(EIndexTypeSql::GlobalSync);
}
- Y_UNIT_TEST(AlterTableAddAsyncIndexShouldFail) {
+ Y_UNIT_TEST(AlterTableAddExplicitAsyncIndex) {
AlterTableAddIndex(EIndexTypeSql::GlobalAsync);
}
- Y_UNIT_TEST(AlterTableAddAsyncIndexShouldSucceed) {
- AlterTableAddIndex(EIndexTypeSql::GlobalAsync, true);
- }
-
Y_UNIT_TEST(AlterTableRenameIndex) {
TKikimrRunner kikimr;
auto db = kikimr.GetTableClient();
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index 97b8506f311..f24199e5854 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -683,7 +683,7 @@ message TFeatureFlags {
optional bool EnableConfigurationCache = 38 [default = false];
optional bool EnableDbCounters = 39 [default = false];
optional bool EnableClockGettimeForUserCpuAccounting = 40 [default = false];
- optional bool EnableAsyncIndexes = 41 [default = true];
+ optional bool EnableAsyncIndexes = 41 [default = true]; // deprecated: always true
optional bool AllowStreamExecuteYqlScript = 42 [default = true];
optional bool EnableKqpScanOverPersistentSnapshot = 43 [default = true]; // deprecated: always true
optional bool EnableOlapSchemaOperations = 44 [default = true];
diff --git a/ydb/core/testlib/basics/feature_flags.h b/ydb/core/testlib/basics/feature_flags.h
index b17b56b6d40..3916ed7b2fc 100644
--- a/ydb/core/testlib/basics/feature_flags.h
+++ b/ydb/core/testlib/basics/feature_flags.h
@@ -25,7 +25,6 @@ public:
FEATURE_FLAG_SETTER(AllowUpdateChannelsBindingOfSolomonPartitions)
FEATURE_FLAG_SETTER(EnableDataColumnForIndexTable)
FEATURE_FLAG_SETTER(EnableClockGettimeForUserCpuAccounting)
- FEATURE_FLAG_SETTER(EnableAsyncIndexes)
FEATURE_FLAG_SETTER(EnableOlapSchemaOperations)
FEATURE_FLAG_SETTER(EnableMvccSnapshotReads)
FEATURE_FLAG_SETTER(EnableBackgroundCompaction)
diff --git a/ydb/core/tx/datashard/datashard_ut_change_collector.cpp b/ydb/core/tx/datashard/datashard_ut_change_collector.cpp
index fe40d93d91f..841d377b402 100644
--- a/ydb/core/tx/datashard/datashard_ut_change_collector.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_change_collector.cpp
@@ -257,8 +257,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeCollector) {
serverSettings
.SetDomainName(domainName)
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -588,7 +587,6 @@ Y_UNIT_TEST_SUITE(CdcStreamChangeCollector) {
.SetDomainName(domainName)
.SetUseRealThreads(false)
.SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true)
.SetCacheParams(cacheParams);
TServer::TPtr server = new TServer(serverSettings);
diff --git a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
index a192f4b5203..60c873c2845 100644
--- a/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_change_exchange.cpp
@@ -35,8 +35,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName(domainName)
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -124,8 +123,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName(domainName)
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -195,8 +193,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName(domainName)
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -275,8 +272,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName("Root")
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -352,8 +348,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName("Root")
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -460,8 +455,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName("Root")
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
@@ -617,8 +611,7 @@ Y_UNIT_TEST_SUITE(AsyncIndexChangeExchange) {
serverSettings
.SetDomainName("Root")
.SetUseRealThreads(false)
- .SetEnableDataColumnForIndexTable(true)
- .SetEnableAsyncIndexes(true);
+ .SetEnableDataColumnForIndexTable(true);
setLimit(serverSettings);
TServer::TPtr server = new TServer(serverSettings);
diff --git a/ydb/core/tx/datashard/datashard_ut_erase_rows.cpp b/ydb/core/tx/datashard/datashard_ut_erase_rows.cpp
index ec59595e581..c1ffc4a9c64 100644
--- a/ydb/core/tx/datashard/datashard_ut_erase_rows.cpp
+++ b/ydb/core/tx/datashard/datashard_ut_erase_rows.cpp
@@ -1689,8 +1689,7 @@ tkey = 100, key = 4
TServerSettings serverSettings(pm.GetPort(2134));
serverSettings
.SetDomainName("Root")
- .SetUseRealThreads(false)
- .SetEnableAsyncIndexes(true);
+ .SetUseRealThreads(false);
TServer::TPtr server = new TServer(serverSettings);
auto& runtime = *server->GetRuntime();
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_indexed_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_indexed_table.cpp
index b3cf6625016..6df6f2dcef6 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_indexed_table.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_indexed_table.cpp
@@ -119,10 +119,7 @@ TVector<ISubOperationBase::TPtr> CreateIndexedTable(TOperationId nextId, const T
switch (indexDescription.GetType()) {
case NKikimrSchemeOp::EIndexType::EIndexTypeGlobalAsync:
- if (!context.SS->EnableAsyncIndexes) {
- TString msg = TStringBuilder() << "It is not allowed to create async indexes";
- return {CreateReject(nextId, NKikimrScheme::EStatus::StatusPreconditionFailed, msg)};
- } else if (baseTableDescription.HasTTLSettings() && !AppData()->FeatureFlags.GetEnableTtlOnAsyncIndexedTables()) {
+ if (baseTableDescription.HasTTLSettings() && !AppData()->FeatureFlags.GetEnableTtlOnAsyncIndexedTables()) {
TString msg = TStringBuilder() << "TTL is not currently supported on tables with async indices";
return {CreateReject(nextId, NKikimrScheme::EStatus::StatusPreconditionFailed, msg)};
}
diff --git a/ydb/core/tx/schemeshard/schemeshard_build_index__create.cpp b/ydb/core/tx/schemeshard/schemeshard_build_index__create.cpp
index 4d5c36591e8..d1de0a0cb94 100644
--- a/ydb/core/tx/schemeshard/schemeshard_build_index__create.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard_build_index__create.cpp
@@ -39,22 +39,6 @@ public:
auto response = MakeHolder<TEvIndexBuilder::TEvCreateResponse>(request.GetTxId());
- switch (request.GetSettings().index().type_case()) {
- case Ydb::Table::TableIndex::kGlobalIndex:
- break;
- case Ydb::Table::TableIndex::kGlobalAsyncIndex:
- if (!Self->EnableAsyncIndexes) {
- return Reply(
- std::move(response),
- Ydb::StatusIds::UNSUPPORTED,
- TStringBuilder() << "Async indexes are not supported yet"
- );
- }
- break;
- default:
- break;
- }
-
const auto& dataColumns = request.GetSettings().index().data_columns();
if (!dataColumns.empty() && !Self->AllowDataColumnForIndexTable) {
diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp
index bb35512dd97..4ef795f29dc 100644
--- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp
@@ -3780,7 +3780,6 @@ TSchemeShard::TSchemeShard(const TActorId &tablet, TTabletStorageInfo *info)
, BorrowedCompactionStarter(this)
, ShardDeleter(info->TabletID)
, AllowDataColumnForIndexTable(0, 0, 1)
- , EnableAsyncIndexes(0, 0, 1)
{
TabletCountersPtr.Reset(new TProtobufTabletCounters<
ESimpleCounters_descriptor,
@@ -3906,9 +3905,6 @@ void TSchemeShard::OnActivateExecutor(const TActorContext &ctx) {
AllowDataColumnForIndexTable = appData->FeatureFlags.GetEnableDataColumnForIndexTable();
appData->Icb->RegisterSharedControl(AllowDataColumnForIndexTable, "SchemeShard_AllowDataColumnForIndexTable");
- EnableAsyncIndexes = appData->FeatureFlags.GetEnableAsyncIndexes();
- appData->Icb->RegisterSharedControl(EnableAsyncIndexes, "SchemeShard_EnableAsyncIndexes");
-
for (const auto& sid : appData->MeteringConfig.GetSystemBackupSIDs()) {
SystemBackupSIDs.insert(sid);
}
diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.h b/ydb/core/tx/schemeshard/schemeshard_impl.h
index becaf324976..6fdec69c0ff 100644
--- a/ydb/core/tx/schemeshard/schemeshard_impl.h
+++ b/ydb/core/tx/schemeshard/schemeshard_impl.h
@@ -1104,7 +1104,6 @@ public:
// namespace NIndexBuilder {
TControlWrapper AllowDataColumnForIndexTable;
- TControlWrapper EnableAsyncIndexes;
THashMap<TIndexBuildId, TIndexBuildInfo::TPtr> IndexBuilds;
THashMap<TString, TIndexBuildInfo::TPtr> IndexBuildsByUid;
diff --git a/ydb/core/tx/schemeshard/ut_async_index.cpp b/ydb/core/tx/schemeshard/ut_async_index.cpp
index a2fc2d39741..e49ce644856 100644
--- a/ydb/core/tx/schemeshard/ut_async_index.cpp
+++ b/ydb/core/tx/schemeshard/ut_async_index.cpp
@@ -6,15 +6,11 @@ using namespace NSchemeShard;
using namespace NSchemeShardUT_Private;
Y_UNIT_TEST_SUITE(TAsyncIndexTests) {
- void CreateTable(bool enableAsyncIndexes) {
+ Y_UNIT_TEST(CreateTable) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime, TTestEnvOptions().EnableAsyncIndexes(enableAsyncIndexes));
+ TTestEnv env(runtime);
ui64 txId = 100;
- const auto status = enableAsyncIndexes
- ? NKikimrScheme::StatusAccepted
- : NKikimrScheme::StatusPreconditionFailed;
-
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
TableDescription {
Name: "Table"
@@ -27,24 +23,13 @@ Y_UNIT_TEST_SUITE(TAsyncIndexTests) {
KeyColumnNames: ["indexed"]
Type: EIndexTypeGlobalAsync
}
- )", {status});
-
- if (enableAsyncIndexes) {
- env.TestWaitNotification(runtime, txId);
- }
- }
-
- Y_UNIT_TEST(CreateTableShouldSucceed) {
- CreateTable(true);
- }
-
- Y_UNIT_TEST(CreateTableShouldFail) {
- CreateTable(false);
+ )");
+ env.TestWaitNotification(runtime, txId);
}
- void OnlineBuild(bool enableAsyncIndexes) {
+ Y_UNIT_TEST(OnlineBuild) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime, TTestEnvOptions().EnableAsyncIndexes(enableAsyncIndexes));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateTable(runtime, ++txId, "/MyRoot", R"(
@@ -55,24 +40,9 @@ Y_UNIT_TEST_SUITE(TAsyncIndexTests) {
)");
env.TestWaitNotification(runtime, txId);
- const auto status = enableAsyncIndexes
- ? Ydb::StatusIds::SUCCESS
- : Ydb::StatusIds::UNSUPPORTED;
-
TestBuilIndex(runtime, ++txId, TTestTxConfig::SchemeShard, "/MyRoot", "/MyRoot/Table", TBuildIndexConfig{
"UserDefinedIndex", NKikimrSchemeOp::EIndexTypeGlobalAsync, {"indexed"}, {}
- }, status);
-
- if (enableAsyncIndexes) {
- env.TestWaitNotification(runtime, txId);
- }
- }
-
- Y_UNIT_TEST(OnlineBuildShouldSucceed) {
- OnlineBuild(true);
- }
-
- Y_UNIT_TEST(OnlineBuildShouldFail) {
- OnlineBuild(false);
+ });
+ env.TestWaitNotification(runtime, txId);
}
}
diff --git a/ydb/core/tx/schemeshard/ut_base.cpp b/ydb/core/tx/schemeshard/ut_base.cpp
index 8c147d0f113..d08639c5d5f 100644
--- a/ydb/core/tx/schemeshard/ut_base.cpp
+++ b/ydb/core/tx/schemeshard/ut_base.cpp
@@ -9873,7 +9873,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
Y_UNIT_TEST(ListNotCreatedDirCase) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime, TTestEnvOptions().EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TVector<THolder<IEventHandle>> supressed;
@@ -9901,7 +9901,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
Y_UNIT_TEST(ListNotCreatedIndexCase) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime, TTestEnvOptions().EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TVector<THolder<IEventHandle>> supressed;
@@ -9985,7 +9985,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardTest) {
Y_UNIT_TEST(ConsistentCopyAfterDropIndexes) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime, TTestEnvOptions().EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateTable(runtime, ++txId, "/MyRoot", R"(
diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp
index 146bb9f10d5..90b7a9f84be 100644
--- a/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp
+++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.cpp
@@ -499,7 +499,6 @@ NSchemeShardUT_Private::TTestEnv::TTestEnv(TTestActorRuntime& runtime, const TTe
app.SetEnablePersistentPartitionStats(opts.EnablePersistentPartitionStats_);
app.SetEnableTtlOnAsyncIndexedTables(opts.EnableTtlOnAsyncIndexedTables_);
app.SetAllowUpdateChannelsBindingOfSolomonPartitions(opts.AllowUpdateChannelsBindingOfSolomonPartitions_);
- app.SetEnableAsyncIndexes(opts.EnableAsyncIndexes_);
app.SetEnableNotNullColumns(opts.EnableNotNullColumns_);
app.SetEnableOlapSchemaOperations(opts.EnableOlapSchemaOperations_);
app.SetEnableProtoSourceIdInfo(opts.EnableProtoSourceIdInfo_);
@@ -1012,7 +1011,6 @@ const NSchemeShardUT_Private::TTestEnvOptions& NSchemeShardUT_Private::TTestWith
NSchemeShardUT_Private::TTestEnvOptions NSchemeShardUT_Private::TTestWithReboots::GetDefaultTestEnvOptions() {
return TTestEnvOptions()
.EnablePipeRetries(false)
- .EnableAsyncIndexes(true)
.EnableNotNullColumns(true)
.EnableProtoSourceIdInfo(true)
.DisableStatsBatching(true)
diff --git a/ydb/core/tx/schemeshard/ut_helpers/test_env.h b/ydb/core/tx/schemeshard/ut_helpers/test_env.h
index ce65a9fef0e..81f5e8da579 100644
--- a/ydb/core/tx/schemeshard/ut_helpers/test_env.h
+++ b/ydb/core/tx/schemeshard/ut_helpers/test_env.h
@@ -36,7 +36,6 @@ namespace NSchemeShardUT_Private {
OPTION(std::optional<bool>, EnablePersistentPartitionStats, std::nullopt);
OPTION(std::optional<bool>, EnableTtlOnAsyncIndexedTables, std::nullopt);
OPTION(std::optional<bool>, AllowUpdateChannelsBindingOfSolomonPartitions, std::nullopt);
- OPTION(std::optional<bool>, EnableAsyncIndexes, std::nullopt);
OPTION(std::optional<bool>, EnableNotNullColumns, std::nullopt);
OPTION(std::optional<bool>, EnableOlapSchemaOperations, true);
OPTION(std::optional<bool>, EnableProtoSourceIdInfo, std::nullopt);
diff --git a/ydb/core/tx/schemeshard/ut_move.cpp b/ydb/core/tx/schemeshard/ut_move.cpp
index fb41356579f..fe66eba3703 100644
--- a/ydb/core/tx/schemeshard/ut_move.cpp
+++ b/ydb/core/tx/schemeshard/ut_move.cpp
@@ -29,9 +29,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(Reject) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -337,9 +335,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(Replace) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -465,9 +461,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(Chain) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -545,9 +539,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(OneTable) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateTable(runtime, ++txId, "/MyRoot", R"(
@@ -672,9 +664,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(Index) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -739,9 +729,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(MoveIndex) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -811,10 +799,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(MoveIndexSameDst) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true)
- .EnableMoveIndex(true));
+ TTestEnv env(runtime, TTestEnvOptions().EnableMoveIndex(true));
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -879,10 +864,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(MoveIndexDoesNonExisted) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true)
- .EnableMoveIndex(true));
+ TTestEnv env(runtime, TTestEnvOptions().EnableMoveIndex(true));
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -947,10 +929,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(MoveIntoBuildingIndex) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true)
- .EnableMoveIndex(true));
+ TTestEnv env(runtime, TTestEnvOptions().EnableMoveIndex(true));
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -1004,9 +983,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(AsyncIndexWithSyncInFly) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateIndexedTable(runtime, ++txId, "/MyRoot", R"(
@@ -1084,9 +1061,7 @@ Y_UNIT_TEST_SUITE(TSchemeShardMoveTest) {
Y_UNIT_TEST(MoveMigratedTable) {
TTestBasicRuntime runtime;
- TTestEnv env(runtime,
- TTestEnvOptions()
- .EnableAsyncIndexes(true));
+ TTestEnv env(runtime);
ui64 txId = 100;
TestCreateSubDomain(runtime, ++txId, "/MyRoot", R"(
diff --git a/ydb/core/tx/schemeshard/ut_ttl.cpp b/ydb/core/tx/schemeshard/ut_ttl.cpp
index 4b54114f3a2..c5a1cb00970 100644
--- a/ydb/core/tx/schemeshard/ut_ttl.cpp
+++ b/ydb/core/tx/schemeshard/ut_ttl.cpp
@@ -143,7 +143,6 @@ Y_UNIT_TEST_SUITE(TSchemeShardTTLTests) {
void CreateTableOnIndexedTable(NKikimrSchemeOp::EIndexType indexType, bool enableTtlOnAsyncIndexedTables = false) {
const auto opts = TTestEnvOptions()
- .EnableAsyncIndexes(true)
.EnableTtlOnAsyncIndexedTables(enableTtlOnAsyncIndexedTables);
TTestBasicRuntime runtime;
@@ -295,7 +294,6 @@ Y_UNIT_TEST_SUITE(TSchemeShardTTLTests) {
void AlterTableOnIndexedTable(NKikimrSchemeOp::EIndexType indexType, bool enableTtlOnAsyncIndexedTables = false) {
const auto opts = TTestEnvOptions()
- .EnableAsyncIndexes(true)
.EnableTtlOnAsyncIndexedTables(enableTtlOnAsyncIndexedTables);
TTestBasicRuntime runtime;
@@ -352,7 +350,6 @@ Y_UNIT_TEST_SUITE(TSchemeShardTTLTests) {
void BuildIndex(NKikimrSchemeOp::EIndexType indexType, bool enableTtlOnAsyncIndexedTables = false) {
const auto opts = TTestEnvOptions()
- .EnableAsyncIndexes(true)
.EnableTtlOnAsyncIndexedTables(enableTtlOnAsyncIndexedTables);
TTestBasicRuntime runtime;
diff --git a/ydb/core/ydb_convert/table_description.cpp b/ydb/core/ydb_convert/table_description.cpp
index dd2e68ef6eb..bddbc72a64f 100644
--- a/ydb/core/ydb_convert/table_description.cpp
+++ b/ydb/core/ydb_convert/table_description.cpp
@@ -338,10 +338,6 @@ bool FillIndexDescription(NKikimrSchemeOp::TIndexedTableCreationConfig& out,
break;
case Ydb::Table::TableIndex::kGlobalAsyncIndex:
- if (!AppData()->FeatureFlags.GetEnableAsyncIndexes()) {
- return returnError(Ydb::StatusIds::UNSUPPORTED, "Async indexes are not supported yet");
- }
-
indexDesc->SetType(NKikimrSchemeOp::EIndexType::EIndexTypeGlobalAsync);
break;
diff --git a/ydb/services/ydb/ydb_common_ut.h b/ydb/services/ydb/ydb_common_ut.h
index 3a188930376..98dd10c49f7 100644
--- a/ydb/services/ydb/ydb_common_ut.h
+++ b/ydb/services/ydb/ydb_common_ut.h
@@ -75,7 +75,6 @@ public:
ServerSettings->AuthConfig = appConfig.GetAuthConfig();
ServerSettings->FeatureFlags = appConfig.GetFeatureFlags();
ServerSettings->SetKqpSettings(kqpSettings);
- ServerSettings->SetEnableAsyncIndexes(true);
ServerSettings->SetEnableDataColumnForIndexTable(true);
ServerSettings->SetEnableNotNullColumns(true);
ServerSettings->SetEnableSystemViews(TestSettings::EnableSystemViews);