]> granicus.if.org Git - postgresql/commitdiff
Add missing Assert and fix inaccurate elog message in standby_redo().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 5 Feb 2012 03:32:35 +0000 (22:32 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 5 Feb 2012 03:32:35 +0000 (22:32 -0500)
All other WAL redo routines either call RestoreBkpBlocks() or Assert that
they haven't been passed any backup blocks.  Make this one do likewise.
Also, fix incorrect routine name in its failure message.

src/backend/storage/ipc/standby.c

index dc6833b3b14ddb0dab77e577b12955673fc3b31a..2924d0ff65dcd4c2e994b78445cf24f737fd838e 100644 (file)
@@ -718,6 +718,9 @@ standby_redo(XLogRecPtr lsn, XLogRecord *record)
 {
        uint8           info = record->xl_info & ~XLR_INFO_MASK;
 
+       /* Backup blocks are not used in standby records */
+       Assert(!(record->xl_info & XLR_BKP_BLOCK_MASK));
+
        /* Do nothing if we're not in hot standby mode */
        if (standbyState == STANDBY_DISABLED)
                return;
@@ -747,7 +750,7 @@ standby_redo(XLogRecPtr lsn, XLogRecord *record)
                ProcArrayApplyRecoveryInfo(&running);
        }
        else
-               elog(PANIC, "relation_redo: unknown op code %u", info);
+               elog(PANIC, "standby_redo: unknown op code %u", info);
 }
 
 static void