summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f60823893db..823efdbed0d 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -9392,7 +9392,7 @@ xlog_redo(XLogReaderState *record)
/* in XLOG rmgr, backup blocks are only used by XLOG_FPI records */
Assert(info == XLOG_FPI || info == XLOG_FPI_FOR_HINT ||
- !XLogRecHasAnyBlockRefs(record));
+ info == XLOG_FPI_MULTI || !XLogRecHasAnyBlockRefs(record));
if (info == XLOG_NEXTOID)
{
@@ -9590,14 +9590,16 @@ xlog_redo(XLogReaderState *record)
{
/* nothing to do here */
}
- else if (info == XLOG_FPI || info == XLOG_FPI_FOR_HINT)
+ else if (info == XLOG_FPI || info == XLOG_FPI_FOR_HINT ||
+ info == XLOG_FPI_MULTI)
{
- Buffer buffer;
+ uint8 block_id;
/*
* Full-page image (FPI) records contain nothing else but a backup
- * block. The block reference must include a full-page image -
- * otherwise there would be no point in this record.
+ * block (or multiple backup blocks). Every block reference must
+ * include a full-page image - otherwise there would be no point in
+ * this record.
*
* No recovery conflicts are generated by these generic records - if a
* resource manager needs to generate conflicts, it has to define a
@@ -9609,9 +9611,14 @@ xlog_redo(XLogReaderState *record)
* XLOG_FPI and XLOG_FPI_FOR_HINT records, they use a different info
* code just to distinguish them for statistics purposes.
*/
- if (XLogReadBufferForRedo(record, 0, &buffer) != BLK_RESTORED)
- elog(ERROR, "unexpected XLogReadBufferForRedo result when restoring backup block");
- UnlockReleaseBuffer(buffer);
+ for (block_id = 0; block_id <= record->max_block_id; block_id++)
+ {
+ Buffer buffer;
+
+ if (XLogReadBufferForRedo(record, block_id, &buffer) != BLK_RESTORED)
+ elog(ERROR, "unexpected XLogReadBufferForRedo result when restoring backup block");
+ UnlockReleaseBuffer(buffer);
+ }
}
else if (info == XLOG_BACKUP_END)
{