Skip to content

Commit

Permalink
Use the entry.isValid to decide whether restore segment or not
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySon-Huang committed May 13, 2022
1 parent ce0cab6 commit 3e46ac2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ DeltaMergeStore::DeltaMergeStore(Context & db_context,
try
{
page_storage_run_mode = storage_pool->restore(); // restore from disk
if (!storage_pool->maxMetaPageId())
if (const auto entry1 = storage_pool->metaReader()->getPageEntry(1);
!entry1.isValid())
{
// Create the first segment.
auto segment_id = storage_pool->newMetaPageId();
Expand Down

0 comments on commit 3e46ac2

Please sign in to comment.