Skip to content

Commit c2a6724

Browse files
committed
Pass more than the first XLogRecData entry to rm_desc, with WAL_DEBUG.
If you compile with WAL_DEBUG and enable it with wal_debug=on, we used to only pass the first XLogRecData entry to the rm_desc routine. I think the original assumprion was that the first XLogRecData entry contains all the necessary information for the rm_desc routine, but that's a pretty shaky assumption. At least standby_redo didn't get the memo. To fix, piece together all the data in a temporary buffer, and pass that to the rm_desc routine. It's been like this forever, but the patch didn't apply cleanly to back-branches. Probably wouldn't be hard to fix the conflicts, but it's not worth the trouble.
1 parent b69c4e6 commit c2a6724

File tree

1 file changed

+16
-1
lines changed
  • src/backend/access/transam

1 file changed

+16
-1
lines changed

src/backend/access/transam/xlog.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,8 +1262,23 @@ begin:;
12621262
xlog_outrec(&buf, rechdr);
12631263
if (rdata->data != NULL)
12641264
{
1265+
StringInfoData recordbuf;
1266+
1267+
/*
1268+
* We have to piece together the WAL record data from the
1269+
* XLogRecData entries, so that we can pass it to the rm_desc
1270+
* function as one contiguous chunk. (but we can leave out any
1271+
* extra entries we created for backup blocks)
1272+
*/
1273+
rdt_lastnormal->next = NULL;
1274+
1275+
initStringInfo(&recordbuf);
1276+
for (;rdata != NULL; rdata = rdata->next)
1277+
appendBinaryStringInfo(&recordbuf, rdata->data, rdata->len);
1278+
12651279
appendStringInfoString(&buf, " - ");
1266-
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, rdata->data);
1280+
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, recordbuf.data);
1281+
pfree(recordbuf.data);
12671282
}
12681283
elog(LOG, "%s", buf.data);
12691284
pfree(buf.data);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy