@@ -5491,7 +5491,7 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
5491
5491
UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 288 );
5492
5492
}
5493
5493
5494
- Y_UNIT_TEST (UseBtreeIndex_True) {
5494
+ Y_UNIT_TEST (UseBtreeIndex_True) { // forcibly disabled in 24-1, uses FlatIndex
5495
5495
TMyEnvBase env;
5496
5496
TRowsModel rows;
5497
5497
@@ -5512,8 +5512,8 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
5512
5512
env.SendSync (new NFake::TEvCompact (TRowsModel::TableId));
5513
5513
env.WaitFor <NFake::TEvCompacted>();
5514
5514
5515
- // all pages are always kept in shared cache (except flat index)
5516
- UNIT_ASSERT_VALUES_EQUAL (counters->ActivePages ->Val (), 334 );
5515
+ // all pages are always kept in shared cache
5516
+ UNIT_ASSERT_VALUES_EQUAL (counters->ActivePages ->Val (), 290 );
5517
5517
5518
5518
env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) });
5519
5519
UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
@@ -5526,96 +5526,9 @@ Y_UNIT_TEST_SUITE(TFlatTableExecutorBTreeIndex) {
5526
5526
// after restart we have no pages in private cache
5527
5527
env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) }, true );
5528
5528
UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
5529
- UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 332 );
5530
- }
5531
-
5532
- Y_UNIT_TEST (UseBtreeIndex_True_TurnOff) {
5533
- TMyEnvBase env;
5534
- TRowsModel rows;
5535
-
5536
- auto &appData = env->GetAppData ();
5537
- appData.FeatureFlags .SetEnableLocalDBBtreeIndex (true );
5538
- auto counters = MakeIntrusive<TSharedPageCacheCounters>(env->GetDynamicCounters ());
5539
- int readRows = 0 , failedAttempts = 0 ;
5540
-
5541
- env.FireDummyTablet (ui32 (NFake::TDummy::EFlg::Comp));
5542
-
5543
- auto policy = MakeIntrusive<TCompactionPolicy>();
5544
- policy->MinBTreeIndexNodeSize = 128 ;
5545
- env.SendSync (rows.MakeScheme (std::move (policy)));
5546
-
5547
- env.SendSync (rows.VersionTo (TRowVersion (1 , 10 )).RowTo (0 ).MakeRows (1000 , 950 ));
5548
- env.SendSync (rows.VersionTo (TRowVersion (2 , 20 )).RowTo (0 ).MakeRows (1000 , 950 ));
5549
-
5550
- env.SendSync (new NFake::TEvCompact (TRowsModel::TableId));
5551
- env.WaitFor <NFake::TEvCompacted>();
5552
-
5553
- // all pages are always kept in shared cache (except flat index)
5554
- UNIT_ASSERT_VALUES_EQUAL (counters->ActivePages ->Val (), 334 );
5555
-
5556
- env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) });
5557
- UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
5558
- UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 0 );
5559
-
5560
- // restart tablet, turn off setting
5561
- env.SendSync (new TEvents::TEvPoison, false , true );
5562
- appData.FeatureFlags .SetEnableLocalDBBtreeIndex (false );
5563
- env.FireDummyTablet (ui32 (NFake::TDummy::EFlg::Comp));
5564
-
5565
- // after restart we have no pages in private cache
5566
- // but use only flat index
5567
- env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) }, true );
5568
- UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
5569
5529
UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 288 );
5570
5530
}
5571
5531
5572
- Y_UNIT_TEST (UseBtreeIndex_True_Generations) {
5573
- TMyEnvBase env;
5574
- TRowsModel rows;
5575
-
5576
- auto &appData = env->GetAppData ();
5577
- appData.FeatureFlags .SetEnableLocalDBBtreeIndex (true );
5578
- auto counters = MakeIntrusive<TSharedPageCacheCounters>(env->GetDynamicCounters ());
5579
- int readRows = 0 , failedAttempts = 0 ;
5580
-
5581
- env.FireDummyTablet (ui32 (NFake::TDummy::EFlg::Comp));
5582
-
5583
- auto policy = MakeIntrusive<TCompactionPolicy>();
5584
- policy->MinBTreeIndexNodeSize = 128 ;
5585
- policy->Generations .push_back ({100 * 1024 , 2 , 2 , 200 * 1024 , NLocalDb::LegacyQueueIdToTaskName (1 ), false });
5586
- for (auto & gen : policy->Generations ) {
5587
- gen.ExtraCompactionPercent = 0 ;
5588
- gen.ExtraCompactionMinSize = 0 ;
5589
- gen.ExtraCompactionExpPercent = 0 ;
5590
- gen.ExtraCompactionExpMaxSize = 0 ;
5591
- gen.UpliftPartSize = 0 ;
5592
- }
5593
- env.SendSync (rows.MakeScheme (std::move (policy)));
5594
-
5595
- env.SendSync (rows.VersionTo (TRowVersion (1 , 10 )).RowTo (0 ).MakeRows (1000 , 950 ));
5596
- env.SendSync (rows.VersionTo (TRowVersion (2 , 20 )).RowTo (0 ).MakeRows (1000 , 950 ));
5597
-
5598
- env.SendSync (new NFake::TEvCompact (TRowsModel::TableId));
5599
- env.WaitFor <NFake::TEvCompacted>();
5600
-
5601
- // gen 0 data pages are always kept in shared cache
5602
- // b-tree index pages are always kept in shared cache
5603
- UNIT_ASSERT_VALUES_EQUAL (counters->ActivePages ->Val (), 48 );
5604
-
5605
- env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) });
5606
- UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
5607
- UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 286 );
5608
-
5609
- // restart tablet
5610
- env.SendSync (new TEvents::TEvPoison, false , true );
5611
- env.FireDummyTablet (ui32 (NFake::TDummy::EFlg::Comp));
5612
-
5613
- // after restart we have no pages in private cache
5614
- env.SendSync (new NFake::TEvExecute{ new TTxFullScan (readRows, failedAttempts) }, true );
5615
- UNIT_ASSERT_VALUES_EQUAL (readRows, 1000 );
5616
- UNIT_ASSERT_VALUES_EQUAL (failedAttempts, 332 );
5617
- }
5618
-
5619
5532
}
5620
5533
5621
5534
} // namespace NTabletFlatExecutor
0 commit comments