Skip to content

Commit 6dfc946

Browse files
committed
Fix description of WAL record XLOG_BTREE_META_CLEANUP
This record uses one metadata buffer and registers some data associated to the buffer, but when parsing the record for its description a direct access to the record data was done, but there is none. This leads usually to an incorrect description, but can also cause crashes like in pg_waldump. Instead, fix things so as the parsing uses the data associated to the metadata block. This is an oversight from 3d92796, so backpatch down to 11. Author: Michael Paquier Description: https://postgr.es/m/20190617013059.GA3153@paquier.xyz Backpatch-through: 11
1 parent 5246d3e commit 6dfc946

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/access/rmgrdesc/nbtdesc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ btree_desc(StringInfo buf, XLogReaderState *record)
9898
}
9999
case XLOG_BTREE_META_CLEANUP:
100100
{
101-
xl_btree_metadata *xlrec = (xl_btree_metadata *) rec;
101+
xl_btree_metadata *xlrec;
102102

103+
xlrec = (xl_btree_metadata *) XLogRecGetBlockData(record, 0,
104+
NULL);
103105
appendStringInfo(buf, "oldest_btpo_xact %u; last_cleanup_num_heap_tuples: %f",
104106
xlrec->oldest_btpo_xact,
105107
xlrec->last_cleanup_num_heap_tuples);

0 commit comments

Comments
 (0)