diff --git a/dbms/src/Storages/Page/V3/PageDirectory.cpp b/dbms/src/Storages/Page/V3/PageDirectory.cpp index 678b888bbd5..80a80216b2c 100644 --- a/dbms/src/Storages/Page/V3/PageDirectory.cpp +++ b/dbms/src/Storages/Page/V3/PageDirectory.cpp @@ -529,9 +529,10 @@ void VersionedPageEntries::copyCheckpointInfoFromEdit(const typename Page // (the checkpoint info) each page's data was dumped. // In this case, there is a living snapshot protecting the data. - // Pre-check: All ENTRY edit record must contain checkpoint info for copying. RUNTIME_CHECK(edit.type == EditRecordType::VAR_ENTRY); - RUNTIME_CHECK(edit.entry.checkpoint_info.has_value()); + // The checkpoint_info from `edit` could be empty when we upload the manifest without any page data + if (!edit.entry.checkpoint_info.has_value()) + return; auto page_lock = acquireLock(); @@ -1854,14 +1855,6 @@ size_t PageDirectory::copyCheckpointInfoFromEdit(const PageEntriesEdit & if (records.empty()) return num_copied; - // Pre-check: All ENTRY edit record must contain checkpoint info. - // We do the pre-check before copying any remote info to avoid partial completion. - for (const auto & rec : records) - { - if (rec.type == EditRecordType::VAR_ENTRY) - RUNTIME_CHECK_MSG(rec.entry.checkpoint_info.has_value(), "try to copy checkpoint from an edit with invalid record: {}", rec); - } - for (const auto & rec : records) { // Only VAR_ENTRY need update checkpoint info. diff --git a/dbms/src/Storages/Page/V3/PageEntriesEdit.cpp b/dbms/src/Storages/Page/V3/PageEntriesEdit.cpp index 5ad5e45648e..cb280c7291c 100644 --- a/dbms/src/Storages/Page/V3/PageEntriesEdit.cpp +++ b/dbms/src/Storages/Page/V3/PageEntriesEdit.cpp @@ -64,11 +64,16 @@ typename PageEntriesEdit::EditRecord PageEntriesEditempty(); } + std::string toDebugString() const { return fmt::format("{{data_file_id: {}, offset_in_file: {}, size_in_file: {}}}", *data_file_id, offset_in_file, size_in_file);