Skip to content

Commit f7330e6

Browse files
kungaazevaykin
authored andcommitted
24-3 Fix tests with EnableLocalDBBtreeIndex = false (ydb-platform#6391)
1 parent 82981cc commit f7330e6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ydb/core/protos/feature_flags.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ message TFeatureFlags {
131131
optional bool EnableStatistics = 106 [default = true];
132132
optional bool EnableUuidAsPrimaryKey = 107 [default = true];
133133
optional bool EnableTablePgTypes = 108 [default = false];
134-
optional bool EnableLocalDBBtreeIndex = 109 [default = true];
134+
optional bool EnableLocalDBBtreeIndex = 109 [default = false];
135135
optional bool EnablePDiskHighHDDInFlight = 110 [default = false];
136136
reserved 111; // UseVDisksBalancing
137137
optional bool EnableViews = 112 [default = false];

ydb/core/tablet_flat/flat_executor_ut.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6230,13 +6230,15 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutor_BTreeIndex) {
62306230
}
62316231
};
62326232

6233-
Y_UNIT_TEST(EnableLocalDBBtreeIndex_Default) { // uses b-tree index
6233+
Y_UNIT_TEST(EnableLocalDBBtreeIndex_Default) { // uses flat index
62346234
TMyEnvBase env;
62356235
TRowsModel rows;
62366236

62376237
auto &appData = env->GetAppData();
62386238
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.HasEnableLocalDBBtreeIndex(), false);
62396239
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.HasEnableLocalDBFlatIndex(), false);
6240+
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.GetEnableLocalDBBtreeIndex(), false);
6241+
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.GetEnableLocalDBFlatIndex(), true);
62406242
auto counters = GetSharedPageCounters(env);
62416243
int readRows = 0, failedAttempts = 0;
62426244

@@ -6252,8 +6254,8 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutor_BTreeIndex) {
62526254
env.SendSync(new NFake::TEvCompact(TRowsModel::TableId));
62536255
env.WaitFor<NFake::TEvCompacted>();
62546256

6255-
// all pages are always kept in shared cache (except flat index)
6256-
UNIT_ASSERT_VALUES_EQUAL(counters->ActivePages->Val(), 334);
6257+
// all pages are always kept in shared cache
6258+
UNIT_ASSERT_VALUES_EQUAL(counters->ActivePages->Val(), 290);
62576259

62586260
env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) });
62596261
UNIT_ASSERT_VALUES_EQUAL(readRows, 1000);
@@ -6266,7 +6268,7 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutor_BTreeIndex) {
62666268
// after restart we have no pages in private cache
62676269
env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) }, true);
62686270
UNIT_ASSERT_VALUES_EQUAL(readRows, 1000);
6269-
UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 330);
6271+
UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 286);
62706272
}
62716273

62726274
Y_UNIT_TEST(EnableLocalDBBtreeIndex_True) { // uses b-tree index

ydb/core/tx/datashard/datashard_ut_followers.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,8 @@ Y_UNIT_TEST_SUITE(DataShardFollowers) {
426426
Cerr << "Captured pages request" << Endl;
427427
for (auto pageId : msg->Fetch->Pages) {
428428
auto type = NTable::NPage::EPage(msg->Fetch->PageCollection->Page(pageId).Type);
429-
UNIT_ASSERT_C(type != NTable::EPage::BTreeIndex && type != NTable::EPage::FlatIndex, "Index pages should be preload during a part switch");
429+
// Note: FlatIndex pages also have been preloaded, but don't stick in private cache (see TLoaderEnv)
430+
UNIT_ASSERT_C(type != NTable::EPage::BTreeIndex, "Index pages should be preload during a part switch");
430431
}
431432
});
432433

0 commit comments

Comments
 (0)