@@ -60,6 +60,7 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
60
60
XLogRecPtr page_lsn ;
61
61
int ret ;
62
62
int try_checksum = 100 ;
63
+ bool is_zero_page = false;
63
64
struct stat st ;
64
65
65
66
header .block = blknum ;
@@ -101,8 +102,8 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
101
102
for (i = 0 ;i < BLCKSZ && page .data [i ]== 0 ;i ++ );
102
103
if (i == BLCKSZ )
103
104
{
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 );
106
107
}
107
108
108
109
/* Try to read and verify this page again several times. */
@@ -122,7 +123,8 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
122
123
* If it's wrong, sleep a bit and then try again
123
124
* several times. If it didn't help, throw error.
124
125
*/
125
- if (current .checksum_version &&
126
+ if (!is_zero_page &&
127
+ current .checksum_version &&
126
128
pg_checksum_page (page .data ,file -> segno * RELSEG_SIZE + blknum )!= ((PageHeader )page .data )-> pd_checksum )
127
129
{
128
130
if (try_checksum )
@@ -143,7 +145,7 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
143
145
144
146
memcpy (write_buffer ,& header ,sizeof (header ));
145
147
memcpy (write_buffer + sizeof (header ),page .data ,BLCKSZ );
146
- /* write data pageexcluding hole */
148
+ /* write data page */
147
149
if (fwrite (write_buffer ,1 ,write_buffer_size ,out )!= write_buffer_size )
148
150
{
149
151
int errno_tmp = errno ;
@@ -228,12 +230,9 @@ backup_data_file(const char *from_root, const char *to_root,
228
230
check_server_version ();
229
231
230
232
/*
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.
237
236
*/
238
237
if (file -> pagemap .bitmapsize == 0 )
239
238
{