@@ -26,6 +26,7 @@ namespace {
26
26
NPage::TConf conf{ true , 2 * 1024 };
27
27
28
28
conf.Group (0 ).IndexMin = 1024 ; /* Should cover index buffer grow code */
29
+ conf.Group (0 ).BTreeIndexNodeTargetSize = 512 ; /* Should cover up/down moves */
29
30
conf.SmallEdge = 19 ; /* Packed to page collection large cell values */
30
31
conf.LargeEdge = 29 ; /* Large values placed to single blobs */
31
32
conf.SliceSize = conf.Group (0 ).PageSize * 4 ;
@@ -53,6 +54,11 @@ namespace {
53
54
return part;
54
55
}
55
56
57
+ bool IsBTreeIndex ()
58
+ {
59
+ return Eggs0 ().Lone ()->IndexPages .BTreeGroups .size ();
60
+ }
61
+
56
62
class TTestPartPageCollection : public NPageCollection ::IPageCollection {
57
63
public:
58
64
TTestPartPageCollection (TIntrusiveConstPtr<NTest::TPartStore> part, ui32 room)
@@ -187,7 +193,7 @@ Y_UNIT_TEST_SUITE(TPartSliceLoader) {
187
193
188
194
Y_UNIT_TEST (RestoreMissingSlice) {
189
195
auto result = RunLoaderTest (Part0 (), nullptr );
190
- UNIT_ASSERT_C (result.Pages == 3 , // index + first + last
196
+ UNIT_ASSERT_C (result.Pages == ( IsBTreeIndex () ? 5 : 1 ) + 2 , // index + first + last
191
197
" Restoring slice bounds needed " << result.Pages << " extra pages" );
192
198
}
193
199
@@ -199,7 +205,7 @@ Y_UNIT_TEST_SUITE(TPartSliceLoader) {
199
205
TIntrusiveConstPtr<TScreen> screen = new TScreen (std::move (holes));
200
206
auto result = RunLoaderTest (Part0 (), screen);
201
207
202
- UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , 3 , // index + first + last
208
+ UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , ( IsBTreeIndex () ? 5 : 1 ) + 2 , // index + first + last
203
209
" Restoring slice [" << startOff << " , " << IndexTools::GetEndRowId (*Part0 ()) + endOff << " ] bounds needed "
204
210
<< result.Pages << " extra pages" );
205
211
}
@@ -227,7 +233,7 @@ Y_UNIT_TEST_SUITE(TPartSliceLoader) {
227
233
screen = new TScreen (std::move (holes));
228
234
}
229
235
auto result = RunLoaderTest (Part0 (), screen);
230
- UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , 1 + IndexTools::CountMainPages (*Part0 ()), // index + all data pages
236
+ UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , ( IsBTreeIndex () ? 70 : 1 ) + IndexTools::CountMainPages (*Part0 ()), // index + all data pages
231
237
" Restoring slice bounds needed " << result.Pages << " extra pages" );
232
238
}
233
239
@@ -254,7 +260,7 @@ Y_UNIT_TEST_SUITE(TPartSliceLoader) {
254
260
screen = new TScreen (std::move (holes));
255
261
}
256
262
auto result = RunLoaderTest (Part0 (), screen);
257
- UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , 1 + IndexTools::CountMainPages (*Part0 ()), // index + all data pages
263
+ UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , ( IsBTreeIndex () ? 70 : 1 ) + IndexTools::CountMainPages (*Part0 ()), // index + all data pages
258
264
" Restoring slice bounds needed " << result.Pages << " extra pages" );
259
265
}
260
266
@@ -283,7 +289,7 @@ Y_UNIT_TEST_SUITE(TPartSliceLoader) {
283
289
screen = new TScreen (std::move (holes));
284
290
}
285
291
auto result = RunLoaderTest (Part0 (), screen);
286
- UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , screen->Size () + 1 , // index + data pages
292
+ UNIT_ASSERT_VALUES_EQUAL_C (result.Pages , ( IsBTreeIndex () ? 70 : 1 ) + screen->Size (), // index + data pages
287
293
" Restoring slice bounds needed " << result.Pages <<
288
294
" extra pages, expected " << screen->Size ());
289
295
}
0 commit comments