Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24-3 Fix tests with EnableLocalDBBtreeIndex = false #6391

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ydb/core/tablet_flat/flat_executor_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6228,13 +6228,15 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
}
};

Y_UNIT_TEST(EnableLocalDBBtreeIndex_Default) { // uses b-tree index
Y_UNIT_TEST(EnableLocalDBBtreeIndex_Default) { // uses flat index
TMyEnvBase env;
TRowsModel rows;

auto &appData = env->GetAppData();
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.HasEnableLocalDBBtreeIndex(), false);
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.HasEnableLocalDBFlatIndex(), false);
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.GetEnableLocalDBBtreeIndex(), false);
UNIT_ASSERT_VALUES_EQUAL(appData.FeatureFlags.GetEnableLocalDBFlatIndex(), true);
auto counters = MakeIntrusive<TSharedPageCacheCounters>(env->GetDynamicCounters());
int readRows = 0, failedAttempts = 0;

Expand All @@ -6250,8 +6252,8 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
env.SendSync(new NFake::TEvCompact(TRowsModel::TableId));
env.WaitFor<NFake::TEvCompacted>();

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

env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) });
UNIT_ASSERT_VALUES_EQUAL(readRows, 1000);
Expand All @@ -6264,7 +6266,7 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
// after restart we have no pages in private cache
env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) }, true);
UNIT_ASSERT_VALUES_EQUAL(readRows, 1000);
UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 330);
UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 288);
}

Y_UNIT_TEST(EnableLocalDBBtreeIndex_True) { // uses b-tree index
Expand Down
3 changes: 2 additions & 1 deletion ydb/core/tx/datashard/datashard_ut_followers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ Y_UNIT_TEST_SUITE(DataShardFollowers) {
Cerr << "Captured pages request" << Endl;
for (auto pageId : msg->Fetch->Pages) {
auto type = NTable::NPage::EPage(msg->Fetch->PageCollection->Page(pageId).Type);
UNIT_ASSERT_C(type != NTable::EPage::BTreeIndex && type != NTable::EPage::FlatIndex, "Index pages should be preload during a part switch");
// Note: FlatIndex pages also have been preloaded, but don't stick in private cache (see TLoaderEnv)
UNIT_ASSERT_C(type != NTable::EPage::BTreeIndex, "Index pages should be preload during a part switch");
}
});

Expand Down
Loading