Fix building with WAL_DEBUG.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 7 Nov 2014 21:04:53 +0000 (23:04 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 7 Nov 2014 21:09:31 +0000 (23:09 +0200)
Now that the backup blocks are appended to the WAL record in xloginsert.c,
XLogInsert doesn't see them anymore and cannot remove them from the version
reconstructed for xlog_outdesc. This makes running with wal_debug=on more
expensive, as we now make (unnecessary) temporary copies of the backup
blocks, but it doesn't seem worth convoluting the code to keep that
optimization.

Reported by Alvaro Herrera.

src/backend/access/transam/xlog.c

index 563d442a7a34a8bb31ebfee414493635f3c894a0..99f702cb804ece6fad877daf445d3cc2697635e1 100644 (file)
@@ -1067,11 +1067,8 @@ XLogInsertRecord(XLogRecData *rdata, XLogRecPtr fpw_lsn)
                        /*
                         * We have to piece together the WAL record data from the
                         * XLogRecData entries, so that we can pass it to the rm_desc
-                        * function as one contiguous chunk. (but we can leave out any
-                        * extra entries we created for backup blocks)
+                        * function as one contiguous chunk.
                         */
-                       rdt_lastnormal->next = NULL;
-
                        initStringInfo(&recordbuf);
                        appendBinaryStringInfo(&recordbuf, (char *) rechdr, sizeof(XLogRecord));
                        for (; rdata != NULL; rdata = rdata->next)