mirror of https://github.com/citusdata/citus.git
Checksums must be set directly before writing the page. log_newpage() sets the page LSN, and therefore invalidates the checksum.pull/5677/head
parent
4bb7283af1
commit
b072b9235e
|
@ -186,17 +186,17 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId)
|
||||||
(char *) &metapage, sizeof(ColumnarMetapage));
|
(char *) &metapage, sizeof(ColumnarMetapage));
|
||||||
phdr->pd_lower += sizeof(ColumnarMetapage);
|
phdr->pd_lower += sizeof(ColumnarMetapage);
|
||||||
|
|
||||||
PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO);
|
|
||||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||||
COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||||
|
PageSetChecksumInplace(page, COLUMNAR_METAPAGE_BLOCKNO);
|
||||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_METAPAGE_BLOCKNO, page, true);
|
||||||
|
|
||||||
/* write empty page */
|
/* write empty page */
|
||||||
PageInit(page, BLCKSZ, 0);
|
PageInit(page, BLCKSZ, 0);
|
||||||
|
|
||||||
PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO);
|
|
||||||
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
log_newpage(&srel->smgr_rnode.node, MAIN_FORKNUM,
|
||||||
COLUMNAR_EMPTY_BLOCKNO, page, true);
|
COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||||
|
PageSetChecksumInplace(page, COLUMNAR_EMPTY_BLOCKNO);
|
||||||
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true);
|
smgrextend(srel, MAIN_FORKNUM, COLUMNAR_EMPTY_BLOCKNO, page, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue