From 41c08dbe20901f6cfd28ce642b39ce53f35ef48a Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Wed, 21 Dec 2022 19:14:55 +0800 Subject: [PATCH] Disable ingest range check (#6519) (#6523) close pingcap/tiflash#6507 --- .../DeltaMerge/DeltaMergeStore_Ingest.cpp | 17 ++++-- .../DeltaMerge/tests/gtest_dm_ingest.cpp | 58 +++++++++---------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp b/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp index 0722d7ee3ba..b68a7dab299 100644 --- a/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp +++ b/dbms/src/Storages/DeltaMerge/DeltaMergeStore_Ingest.cpp @@ -538,11 +538,18 @@ void DeltaMergeStore::ingestFiles( } // Check whether all external files are contained by the range. - for (const auto & ext_file : external_files) - { - RUNTIME_CHECK(compare(range.getStart(), ext_file.range.getStart()) <= 0); - RUNTIME_CHECK(compare(range.getEnd(), ext_file.range.getEnd()) >= 0); - } + // Currently this check is disabled, see https://github.com/pingcap/tiflash/pull/6519 + // for (const auto & ext_file : external_files) + // { + // RUNTIME_CHECK( + // compare(range.getStart(), ext_file.range.getStart()) <= 0, + // range.toDebugString(), + // ext_file.range.toDebugString()); + // RUNTIME_CHECK( + // compare(range.getEnd(), ext_file.range.getEnd()) >= 0, + // range.toDebugString(), + // ext_file.range.toDebugString()); + // } } EventRecorder write_block_recorder(ProfileEvents::DMWriteFile, ProfileEvents::DMWriteFileNS); diff --git a/dbms/src/Storages/DeltaMerge/tests/gtest_dm_ingest.cpp b/dbms/src/Storages/DeltaMerge/tests/gtest_dm_ingest.cpp index 2c04541be4e..c6a426fc79b 100644 --- a/dbms/src/Storages/DeltaMerge/tests/gtest_dm_ingest.cpp +++ b/dbms/src/Storages/DeltaMerge/tests/gtest_dm_ingest.cpp @@ -78,35 +78,35 @@ try } CATCH -TEST_P(StoreIngestTest, RangeSmallerThanData) -try -{ - ASSERT_EQ(0, getRowsN()); - auto block1 = fillBlock({.range = {0, 100}}); - ASSERT_THROW({ - ingestFiles({.range = {20, 40}, .blocks = {block1}, .clear = false}); - }, - DB::Exception); -} -CATCH - -TEST_P(StoreIngestTest, RangeLargerThanData) -try -{ - ASSERT_EQ(0, getRowsN()); - auto block1 = fillBlock({.range = {0, 100}}); - ingestFiles({.range = {-100, 110}, .blocks = {block1}, .clear = false}); - ASSERT_TRUE(isFilled(0, 100)); - ASSERT_EQ(100, getRowsN()); - - fill(-500, 500); - ingestFiles({.range = {-100, 110}, .blocks = {block1}, .clear = true}); - ASSERT_TRUE(isFilled(-500, -100)); - ASSERT_TRUE(isFilled(0, 100)); - ASSERT_TRUE(isFilled(110, 500)); - ASSERT_EQ(890, getRowsN()); -} -CATCH +//TEST_P(StoreIngestTest, RangeSmallerThanData) +//try +//{ +// ASSERT_EQ(0, getRowsN()); +// auto block1 = fillBlock({.range = {0, 100}}); +// ASSERT_THROW({ +// ingestFiles({.range = {20, 40}, .blocks = {block1}, .clear = false}); +// }, +// DB::Exception); +//} +//CATCH +// +//TEST_P(StoreIngestTest, RangeLargerThanData) +//try +//{ +// ASSERT_EQ(0, getRowsN()); +// auto block1 = fillBlock({.range = {0, 100}}); +// ingestFiles({.range = {-100, 110}, .blocks = {block1}, .clear = false}); +// ASSERT_TRUE(isFilled(0, 100)); +// ASSERT_EQ(100, getRowsN()); +// +// fill(-500, 500); +// ingestFiles({.range = {-100, 110}, .blocks = {block1}, .clear = true}); +// ASSERT_TRUE(isFilled(-500, -100)); +// ASSERT_TRUE(isFilled(0, 100)); +// ASSERT_TRUE(isFilled(110, 500)); +// ASSERT_EQ(890, getRowsN()); +//} +//CATCH TEST_P(StoreIngestTest, OverlappedFiles) try