@@ -860,7 +860,8 @@ CATCH
860
860
TEST_P (DeltaMergeStoreRWTest, WriteMultipleBlock)
861
861
try
862
862
{
863
- const size_t num_write_rows = 32 ;
863
+ constexpr size_t num_write_rows = 32 ;
864
+ constexpr bool clear_data_in_range = true ;
864
865
865
866
// Test write multi blocks without overlap
866
867
{
888
889
auto file_ids = file_ids1;
889
890
file_ids.insert (file_ids.cend (), file_ids2.begin (), file_ids2.end ());
890
891
file_ids.insert (file_ids.cend (), file_ids3.begin (), file_ids3.end ());
891
- store->ingestFiles (dm_context, range, file_ids, false );
892
+ store->ingestFiles (dm_context, range, file_ids, !clear_data_in_range );
892
893
break ;
893
894
}
894
895
case TestMode::PageStorageV2_MemoryAndDisk:
900
901
auto range = range1.merge (range3);
901
902
auto file_ids = file_ids1;
902
903
file_ids.insert (file_ids.cend (), file_ids3.begin (), file_ids3.end ());
903
- store->ingestFiles (dm_context, range, file_ids, false );
904
+ store->ingestFiles (dm_context, range, file_ids, !clear_data_in_range );
904
905
905
906
store->write (*db_context, db_context->getSettingsRef (), block2);
906
907
break ;
938
939
939
940
// Test write multi blocks with overlap
940
941
{
941
- UInt64 tso1 = 1 ;
942
+ UInt64 tso1 = 3 ; // ts of the same key should incre...
942
943
UInt64 tso2 = 100 ;
943
944
Block block1 = DMTestEnv::prepareSimpleWriteBlock (0 , 1 * num_write_rows, false , tso1);
944
945
Block block2 = DMTestEnv::prepareSimpleWriteBlock (1 * num_write_rows, 2 * num_write_rows, false , tso1);
@@ -960,11 +961,11 @@ try
960
961
{
961
962
auto dm_context = store->newDMContext (*db_context, db_context->getSettingsRef ());
962
963
auto [range1, file_ids1] = genDMFile (*dm_context, block1);
963
- store->ingestFiles (dm_context, range1, {file_ids1}, false );
964
+ store->ingestFiles (dm_context, range1, {file_ids1}, clear_data_in_range );
964
965
auto [range2, file_ids2] = genDMFile (*dm_context, block2);
965
- store->ingestFiles (dm_context, range2, {file_ids2}, false );
966
+ store->ingestFiles (dm_context, range2, {file_ids2}, clear_data_in_range );
966
967
auto [range3, file_ids3] = genDMFile (*dm_context, block3);
967
- store->ingestFiles (dm_context, range3, {file_ids3}, false );
968
+ store->ingestFiles (dm_context, range3, {file_ids3}, clear_data_in_range );
968
969
break ;
969
970
}
970
971
case TestMode::PageStorageV2_MemoryAndDisk:
974
975
975
976
auto dm_context = store->newDMContext (*db_context, db_context->getSettingsRef ());
976
977
auto [range1, file_ids1] = genDMFile (*dm_context, block1);
977
- store->ingestFiles (dm_context, range1, {file_ids1}, false );
978
+ store->ingestFiles (dm_context, range1, {file_ids1}, clear_data_in_range );
978
979
auto [range3, file_ids3] = genDMFile (*dm_context, block3);
979
- store->ingestFiles (dm_context, range3, {file_ids3}, false );
980
+ store->ingestFiles (dm_context, range3, {file_ids3}, clear_data_in_range );
980
981
break ;
981
982
}
982
983
}
@@ -1018,8 +1019,8 @@ try
1018
1019
db_context->getSettingsRef (),
1019
1020
columns,
1020
1021
{RowKeyRange::newAll (store->isCommonHandle (), store->getRowKeyColumnSize ())},
1021
- /* num_streams= */ 1 ,
1022
- /* start_ts= */ static_cast <UInt64 >(1 ),
1022
+ /* num_streams= */ 2 ,
1023
+ /* start_ts= */ static_cast <UInt64 >(2 ),
1023
1024
EMPTY_FILTER,
1024
1025
std::vector<RuntimeFilterPtr>{},
1025
1026
0 ,
@@ -1031,7 +1032,7 @@ try
1031
1032
in,
1032
1033
Strings ({DMTestEnv::pk_name}),
1033
1034
createColumns ({
1034
- createColumn<Int64>(createNumbers<Int64>(0 , 2 * num_write_rows )),
1035
+ createColumn<Int64>(createNumbers<Int64>(64 , 96 )),
1035
1036
}));
1036
1037
}
1037
1038
}
@@ -3903,6 +3904,16 @@ CATCH
3903
3904
3904
3905
void DeltaMergeStoreRWTest::dupHandleVersionAndDeltaIndexAdvancedThanSnapshot ()
3905
3906
{
3907
+ // Always use delta index in this case.
3908
+ auto & global_settings = db_context->getGlobalContext ().getSettingsRef ();
3909
+ bool enable_version_chain = global_settings.dt_enable_version_chain ;
3910
+ if (enable_version_chain)
3911
+ global_settings.set (" dt_enable_version_chain" , " false" );
3912
+ SCOPE_EXIT ({
3913
+ if (enable_version_chain)
3914
+ global_settings.set (" dt_enable_version_chain" , " true" );
3915
+ });
3916
+
3906
3917
auto table_column_defines = DMTestEnv::getDefaultColumns ();
3907
3918
store = reload (table_column_defines);
3908
3919
0 commit comments