diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-06-19 11:02:28 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-06-19 11:02:28 +0900 |
commit | 6dfc9464472ec283cf6b13ee67b42afc6346c533 (patch) | |
tree | bdd1ac2b1c0ed6d759a2d21b5a420c78af1d2472 /src/backend/access | |
parent | 5246d3e791033267516b66ce3518f9cc6c23c261 (diff) | |
download | postgresql-6dfc9464472ec283cf6b13ee67b42afc6346c533.tar.gz postgresql-6dfc9464472ec283cf6b13ee67b42afc6346c533.zip |
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
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/rmgrdesc/nbtdesc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/rmgrdesc/nbtdesc.c b/src/backend/access/rmgrdesc/nbtdesc.c index 5c4457179de..80bd70a9751 100644 --- a/src/backend/access/rmgrdesc/nbtdesc.c +++ b/src/backend/access/rmgrdesc/nbtdesc.c @@ -98,8 +98,10 @@ btree_desc(StringInfo buf, XLogReaderState *record) } case XLOG_BTREE_META_CLEANUP: { - xl_btree_metadata *xlrec = (xl_btree_metadata *) rec; + xl_btree_metadata *xlrec; + xlrec = (xl_btree_metadata *) XLogRecGetBlockData(record, 0, + NULL); appendStringInfo(buf, "oldest_btpo_xact %u; last_cleanup_num_heap_tuples: %f", xlrec->oldest_btpo_xact, xlrec->last_cleanup_num_heap_tuples); |