@@ -60,6 +60,7 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
6060XLogRecPtr page_lsn ;
6161int ret ;
6262int try_checksum = 100 ;
63+ bool is_zero_page = false;
6364struct stat st ;
6465
6566header .block = blknum ;
@@ -101,8 +102,8 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
101102for (i = 0 ;i < BLCKSZ && page .data [i ]== 0 ;i ++ );
102103if (i == BLCKSZ )
103104{
104- // FIXME Fix this hell.
105- elog (ERROR ,"File: %s blknum %u, empty page" ,file -> path ,blknum );
105+ is_zero_page = true;
106+ elog (LOG ,"File: %s blknum %u, empty page" ,file -> path ,blknum );
106107}
107108
108109/* Try to read and verify this page again several times. */
@@ -122,7 +123,8 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
122123 * If it's wrong, sleep a bit and then try again
123124 * several times. If it didn't help, throw error.
124125 */
125- if (current .checksum_version &&
126+ if (!is_zero_page &&
127+ current .checksum_version &&
126128pg_checksum_page (page .data ,file -> segno * RELSEG_SIZE + blknum )!= ((PageHeader )page .data )-> pd_checksum )
127129{
128130if (try_checksum )
@@ -143,7 +145,7 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
143145
144146memcpy (write_buffer ,& header ,sizeof (header ));
145147memcpy (write_buffer + sizeof (header ),page .data ,BLCKSZ );
146- /* write data pageexcluding hole */
148+ /* write data page */
147149if (fwrite (write_buffer ,1 ,write_buffer_size ,out )!= write_buffer_size )
148150{
149151int errno_tmp = errno ;
@@ -228,12 +230,9 @@ backup_data_file(const char *from_root, const char *to_root,
228230check_server_version ();
229231
230232/*
231- * Read each page and write the page excluding hole. If it has been
232- * determined that the page can be copied safely, but no page map
233- * has been built, it means that we are in presence of a relation
234- * file that needs to be completely scanned. If a page map is present
235- * only scan the blocks needed. In each case, pages are copied without
236- * their hole to ensure some basic level of compression.
233+ * Read each page, verify checksum and write it to backup.
234+ * If page map is not empty we scan only these blocks, otherwise
235+ * backup all pages of the relation.
237236 */
238237if (file -> pagemap .bitmapsize == 0 )
239238{