Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lidezhu committed Feb 14, 2023
1 parent 5e4cd29 commit 6a81b9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dbms/src/Storages/DeltaMerge/tests/gtest_dm_minmax_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ bool checkMatch(
Block header = toEmptyBlock(table_columns);
Block block = genBlock(header, block_tuples);

// max page id is only updated at restart, so we need recreate page v3 before recreate table
context.initializeGlobalStoragePoolIfNeed(context.getPathPool());
DeltaMergeStorePtr store = std::make_shared<DeltaMergeStore>(
context,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ try
table_info.is_common_handle = false;
table_info.pk_is_handle = false;

// max page id is only updated at restart, so we need recreate page v3 before recreate table
ctx.initializeGlobalStoragePoolIfNeed(ctx.getPathPool());
storage = StorageDeltaMerge::create("TiFlash",
/* db_name= */ "default",
table_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PageStorageMixedTest : public DB::base::TiFlashStorageTestBasic
storage_pool_v2 = std::make_unique<DM::StoragePool>(global_context, TEST_NAMESPACE_ID, *storage_path_pool_v2, "test.t1");

global_context.setPageStorageRunMode(PageStorageRunMode::MIX_MODE);
storage_pool_mix = std::make_unique<DM::StoragePool>(global_context,
storage_pool_mix = std::make_unique<DM::StoragePool>(*db_context,
TEST_NAMESPACE_ID,
*storage_path_pool_v2,
"test.t1");
Expand Down Expand Up @@ -683,7 +683,7 @@ try

{
ASSERT_EQ(reloadMixedStoragePool(), PageStorageRunMode::MIX_MODE);
ASSERT_EQ(storage_pool_mix->newLogPageId(), 4);
// ASSERT_EQ(storage_pool_mix->newLogPageId(), 4); // max id for v3 will not be updated, ignore this check
}
}
CATCH
Expand Down Expand Up @@ -728,7 +728,7 @@ try

{
ASSERT_EQ(reloadMixedStoragePool(), PageStorageRunMode::ONLY_V3);
ASSERT_EQ(storage_pool_mix->newLogPageId(), 2);
// ASSERT_EQ(storage_pool_mix->newLogPageId(), 2); // max id for v3 will not be updated, ignore this check
}
}
CATCH
Expand Down Expand Up @@ -758,7 +758,7 @@ try
{
ASSERT_EQ(reloadMixedStoragePool(), PageStorageRunMode::MIX_MODE);
ASSERT_EQ(page_reader_mix->getNormalPageId(2), 1);
ASSERT_EQ(storage_pool_mix->newLogPageId(), 3);
// ASSERT_EQ(storage_pool_mix->newLogPageId(), 3); // max id for v3 will not be updated, ignore this check
}

auto snapshot_before_del = page_reader_mix->getSnapshot("ReadWithSnapshotBeforeDelOrigin");
Expand Down

0 comments on commit 6a81b9a

Please sign in to comment.