From b072b9235e3c312e4a51cbbcf051e29451c30102 Mon Sep 17 00:00:00 2001 From: jeff-davis Date: Wed, 2 Feb 2022 13:22:11 -0800 Subject: [PATCH] Columnar: fix checksums, broken in a4067913. (#5669) Checksums must be set directly before writing the page. log_newpage() sets the page LSN, and therefore invalidates the checksum. --- src/backend/columnar/columnar_storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/columnar/columnar_storage.c b/src/backend/columnar/columnar_storage.c index 58eb87b7e..71fc75ccb 100644 --- a/src/backend/columnar/columnar_storage.c +++ b/src/backend/columnar/columnar_storage.c @@ -186,17 +186,17 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId) (char *) &metapage, sizeof(ColumnarMetapage)); phdr->pd_lower += sizeof(ColumnarMetapage); - PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO); log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true); + PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO); smgrextend(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true); /* write empty page */ PageInit(page, BLCKSZ, 0); - PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO); log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true); + PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO); smgrextend(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true); /*