diff --git a/src/backend/access/transam/generic_xlog.c b/src/backend/access/transam/generic_xlog.c
new file mode 100644
index 072838a..ce6fc80
*** a/src/backend/access/transam/generic_xlog.c
--- b/src/backend/access/transam/generic_xlog.c
*************** GenericXLogFinish(GenericXLogState *stat
*** 338,343 ****
--- 338,344 ----
  		{
  			PageData   *pageData = &state->pages[i];
  			Page		page;
+ 			PageHeader	pageHeader;
  
  			if (BufferIsInvalid(pageData->buffer))
  				continue;
*************** GenericXLogFinish(GenericXLogState *stat
*** 363,368 ****
--- 364,377 ----
  				XLogRegisterBuffer(i, pageData->buffer, REGBUF_STANDARD);
  				XLogRegisterBufData(i, pageData->delta, pageData->deltaLen);
  			}
+ 
+ 			/*
+ 			 * Explicitly zero "hole" between pd_lower and pd_upper in order to
+ 			 * avoid divergence between master and slave during replication.
+ 			 */
+ 			pageHeader = (PageHeader) page;
+ 			memset(page + pageHeader->pd_lower, 0,
+ 				   pageHeader->pd_upper - pageHeader->pd_lower);
  		}
  
  		/* Insert xlog record */
*************** generic_redo(XLogReaderState *record)
*** 473,478 ****
--- 482,488 ----
  		if (action == BLK_NEEDS_REDO)
  		{
  			Page		page;
+ 			PageHeader	pageHeader;
  			char	   *blockDelta;
  			Size		blockDeltaSize;
  
*************** generic_redo(XLogReaderState *record)
*** 481,486 ****
--- 491,504 ----
  			blockDelta = XLogRecGetBlockData(record, block_id, &blockDeltaSize);
  			applyPageRedo(page, blockDelta, blockDeltaSize);
  
+ 			/*
+ 			 * Explicitly zero "hole" between pd_lower and pd_upper in order to
+ 			 * avoid divergence between master and slave during replication.
+ 			 */
+ 			pageHeader = (PageHeader) page;
+ 			memset(page + pageHeader->pd_lower, 0,
+ 				   pageHeader->pd_upper - pageHeader->pd_lower);
+ 
  			PageSetLSN(page, lsn);
  			MarkBufferDirty(buffers[block_id]);
  		}
