Skip to content

Commit

Permalink
Calculate pages checksum in the WAL redo loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ololobus committed May 9, 2022
1 parent 9a9459a commit 9dc2dec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/zenith/pagestore_smgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ PageIsEmptyHeapPage(char *buffer)

PageInit((Page) empty_page.data, BLCKSZ, 0);

/* Ignore checksum when comparing empty pages */
((PageHeader)empty_page.data)->pd_checksum = ((PageHeader)buffer)->pd_checksum;

return memcmp(buffer, empty_page.data, BLCKSZ) == 0;
}

Expand Down
3 changes: 3 additions & 0 deletions src/backend/tcop/zenith_wal_redo.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@ GetPage(StringInfo input_message)
page = BufferGetPage(buf);
/* single thread, so don't bother locking the page */

/* Calculate checksums on the newly materialized page if needed. */
PageSetChecksumInplace(page, blknum);

/* Response: Page content */
tot_written = 0;
do {
Expand Down

0 comments on commit 9dc2dec

Please sign in to comment.