Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 96fe569

Browse files
committed
Add nblocks into error message
1 parent 42369f4 commit 96fe569

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

data.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ parse_page(const DataPage *page, XLogRecPtr *lsn)
4747

4848
static void
4949
backup_data_page(pgFile *file, const XLogRecPtr *lsn,
50-
BlockNumber blknum, FILE *in, FILE *out,
50+
BlockNumber blknum, BlockNumber nblocks,
51+
FILE *in, FILE *out,
5152
pg_crc32 *crc)
5253
{
5354
BackupPageHeader header;
@@ -72,8 +73,8 @@ backup_data_page(pgFile *file, const XLogRecPtr *lsn,
7273

7374
read_len = fread(&page, 1, sizeof(page), in);
7475
if (read_len != sizeof(page))
75-
elog(ERROR, "File: %s, block size of block %u is incorrect %lu",
76-
file->path, blknum, read_len);
76+
elog(ERROR, "File: %s, block size of block %u of nblocks %u is incorrect %lu",
77+
file->path, blknum, nblocks, read_len);
7778

7879
/*
7980
* If an invalid data page was found, fallback to simple copy to ensure
@@ -223,14 +224,14 @@ backup_data_file(const char *from_root, const char *to_root,
223224
if (file->pagemap.bitmapsize == 0)
224225
{
225226
for (blknum = 0; blknum < nblocks; blknum++)
226-
backup_data_page(file, lsn, blknum, in, out, &crc);
227+
backup_data_page(file, lsn, blknum, nblocks, in, out, &crc);
227228
}
228229
else
229230
{
230231
datapagemap_iterator_t *iter;
231232
iter = datapagemap_iterate(&file->pagemap);
232233
while (datapagemap_next(iter, &blknum))
233-
backup_data_page(file, lsn, blknum, in, out, &crc);
234+
backup_data_page(file, lsn, blknum, nblocks, in, out, &crc);
234235

235236
pg_free(iter);
236237
/*

0 commit comments

Comments
 (0)