Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc2a6724

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 toonly pass the first XLogRecData entry to the rm_desc routine. I think theoriginal assumprion was that the first XLogRecData entry contains all thenecessary information for the rm_desc routine, but that's a pretty shakyassumption. At least standby_redo didn't get the memo.To fix, piece together all the data in a temporary buffer, and pass that tothe rm_desc routine.It's been like this forever, but the patch didn't apply cleanly toback-branches. Probably wouldn't be hard to fix the conflicts, but it'snot worth the trouble.
1 parentb69c4e6 commitc2a6724

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+
StringInfoDatarecordbuf;
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)

[8]ページ先頭

©2009-2025 Movatter.jp