diff --git a/ydb/core/tablet_flat/flat_executor.cpp b/ydb/core/tablet_flat/flat_executor.cpp index 58ca70001c3f..d46455f49554 100644 --- a/ydb/core/tablet_flat/flat_executor.cpp +++ b/ydb/core/tablet_flat/flat_executor.cpp @@ -4321,7 +4321,7 @@ ui64 TExecutor::BeginCompaction(THolder params) comp->Epoch = snapshot->Subset->Epoch(); /* narrows requested to actual */ comp->Layout.Final = comp->Params->IsFinal; - comp->Layout.WriteBTreeIndex = AppData()->FeatureFlags.GetEnableLocalDBBtreeIndex(); + comp->Layout.WriteBTreeIndex = false; // will be in 24-2: AppData()->FeatureFlags.GetEnableLocalDBBtreeIndex(); comp->Writer.StickyFlatIndex = !comp->Layout.WriteBTreeIndex; comp->Layout.MaxRows = snapshot->Subset->MaxRows(); comp->Layout.ByKeyFilter = tableInfo->ByKeyFilter; diff --git a/ydb/core/tablet_flat/flat_executor_ut.cpp b/ydb/core/tablet_flat/flat_executor_ut.cpp index 18d8399728bf..52f2bb32a940 100644 --- a/ydb/core/tablet_flat/flat_executor_ut.cpp +++ b/ydb/core/tablet_flat/flat_executor_ut.cpp @@ -5491,7 +5491,7 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) { UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 288); } - Y_UNIT_TEST(UseBtreeIndex_True) { + Y_UNIT_TEST(UseBtreeIndex_True) { // forcibly disabled in 24-1, uses FlatIndex TMyEnvBase env; TRowsModel rows; @@ -5512,8 +5512,8 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) { env.SendSync(new NFake::TEvCompact(TRowsModel::TableId)); env.WaitFor(); - // 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); @@ -5526,96 +5526,9 @@ 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, 332); - } - - Y_UNIT_TEST(UseBtreeIndex_True_TurnOff) { - TMyEnvBase env; - TRowsModel rows; - - auto &appData = env->GetAppData(); - appData.FeatureFlags.SetEnableLocalDBBtreeIndex(true); - auto counters = MakeIntrusive(env->GetDynamicCounters()); - int readRows = 0, failedAttempts = 0; - - env.FireDummyTablet(ui32(NFake::TDummy::EFlg::Comp)); - - auto policy = MakeIntrusive(); - policy->MinBTreeIndexNodeSize = 128; - env.SendSync(rows.MakeScheme(std::move(policy))); - - env.SendSync(rows.VersionTo(TRowVersion(1, 10)).RowTo(0).MakeRows(1000, 950)); - env.SendSync(rows.VersionTo(TRowVersion(2, 20)).RowTo(0).MakeRows(1000, 950)); - - env.SendSync(new NFake::TEvCompact(TRowsModel::TableId)); - env.WaitFor(); - - // all pages are always kept in shared cache (except flat index) - UNIT_ASSERT_VALUES_EQUAL(counters->ActivePages->Val(), 334); - - env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) }); - UNIT_ASSERT_VALUES_EQUAL(readRows, 1000); - UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 0); - - // restart tablet, turn off setting - env.SendSync(new TEvents::TEvPoison, false, true); - appData.FeatureFlags.SetEnableLocalDBBtreeIndex(false); - env.FireDummyTablet(ui32(NFake::TDummy::EFlg::Comp)); - - // after restart we have no pages in private cache - // but use only flat index - env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) }, true); - UNIT_ASSERT_VALUES_EQUAL(readRows, 1000); UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 288); } - Y_UNIT_TEST(UseBtreeIndex_True_Generations) { - TMyEnvBase env; - TRowsModel rows; - - auto &appData = env->GetAppData(); - appData.FeatureFlags.SetEnableLocalDBBtreeIndex(true); - auto counters = MakeIntrusive(env->GetDynamicCounters()); - int readRows = 0, failedAttempts = 0; - - env.FireDummyTablet(ui32(NFake::TDummy::EFlg::Comp)); - - auto policy = MakeIntrusive(); - policy->MinBTreeIndexNodeSize = 128; - policy->Generations.push_back({100 * 1024, 2, 2, 200 * 1024, NLocalDb::LegacyQueueIdToTaskName(1), false}); - for (auto& gen : policy->Generations) { - gen.ExtraCompactionPercent = 0; - gen.ExtraCompactionMinSize = 0; - gen.ExtraCompactionExpPercent = 0; - gen.ExtraCompactionExpMaxSize = 0; - gen.UpliftPartSize = 0; - } - env.SendSync(rows.MakeScheme(std::move(policy))); - - env.SendSync(rows.VersionTo(TRowVersion(1, 10)).RowTo(0).MakeRows(1000, 950)); - env.SendSync(rows.VersionTo(TRowVersion(2, 20)).RowTo(0).MakeRows(1000, 950)); - - env.SendSync(new NFake::TEvCompact(TRowsModel::TableId)); - env.WaitFor(); - - // gen 0 data pages are always kept in shared cache - // b-tree index pages are always kept in shared cache - UNIT_ASSERT_VALUES_EQUAL(counters->ActivePages->Val(), 48); - - env.SendSync(new NFake::TEvExecute{ new TTxFullScan(readRows, failedAttempts) }); - UNIT_ASSERT_VALUES_EQUAL(readRows, 1000); - UNIT_ASSERT_VALUES_EQUAL(failedAttempts, 286); - - // restart tablet - env.SendSync(new TEvents::TEvPoison, false, true); - env.FireDummyTablet(ui32(NFake::TDummy::EFlg::Comp)); - - // 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, 332); - } - } } // namespace NTabletFlatExecutor diff --git a/ydb/core/tablet_flat/flat_part_loader.cpp b/ydb/core/tablet_flat/flat_part_loader.cpp index 294e2be31516..127219f2ca53 100644 --- a/ydb/core/tablet_flat/flat_part_loader.cpp +++ b/ydb/core/tablet_flat/flat_part_loader.cpp @@ -78,7 +78,7 @@ void TLoader::StageParseMeta() noexcept BTreeGroupIndexes.clear(); BTreeHistoricIndexes.clear(); - if (AppData()->FeatureFlags.GetEnableLocalDBBtreeIndex()) { + if (false) { // will be in 24-2: AppData()->FeatureFlags.GetEnableLocalDBBtreeIndex() for (bool history : {false, true}) { for (const auto &meta : history ? layout.GetBTreeHistoricIndexes() : layout.GetBTreeGroupIndexes()) { NPage::TBtreeIndexMeta converted{{