Fix wal_consistency_checking enhanced desc output.
Recent enhancements to rmgr desc routines that made the output summarize certain block data (added by commits 7d8219a4 and 1c453cfd) dealt with records that lack relevant block data (and so have nothing to give a more detailed summary of) by testing !DecodedBkpBlock.has_image. As a result, more detailed descriptions of block data were not output when wal_consistency_checking was enabled. This bug affected records with summarizable block data that also happened to have an FPI that the REDO routine isn't supposed to apply (FPIs used for consistency checking purposes only). The presence of such an FPI was incorrectly taken to indicate the absence of block data. To fix, test DecodedBkpBlock.has_data, not !DecodedBkpBlock.has_image. This is the exact condition that we care about, not an inexact proxy. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-Wzm5Sc9cBg1qWV_cEBfLNJCrW9FjS-SoHVt8FLA7Ldn8yg@mail.gmail.com
This commit is contained in:
parent
9e1e9d6560
commit
50547a3fae
@ -184,7 +184,7 @@ heap2_desc(StringInfo buf, XLogReaderState *record)
|
||||
xlrec->nredirected,
|
||||
xlrec->ndead);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0))
|
||||
if (XLogRecHasBlockData(record, 0))
|
||||
{
|
||||
OffsetNumber *end;
|
||||
OffsetNumber *redirected;
|
||||
@ -223,7 +223,7 @@ heap2_desc(StringInfo buf, XLogReaderState *record)
|
||||
|
||||
appendStringInfo(buf, "nunused: %u", xlrec->nunused);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0))
|
||||
if (XLogRecHasBlockData(record, 0))
|
||||
{
|
||||
OffsetNumber *nowunused;
|
||||
|
||||
@ -241,7 +241,7 @@ heap2_desc(StringInfo buf, XLogReaderState *record)
|
||||
appendStringInfo(buf, "snapshotConflictHorizon: %u, nplans: %u",
|
||||
xlrec->snapshotConflictHorizon, xlrec->nplans);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0))
|
||||
if (XLogRecHasBlockData(record, 0))
|
||||
{
|
||||
xl_heap_freeze_plan *plans;
|
||||
OffsetNumber *offsets;
|
||||
@ -270,7 +270,7 @@ heap2_desc(StringInfo buf, XLogReaderState *record)
|
||||
appendStringInfo(buf, "ntuples: %d, flags: 0x%02X", xlrec->ntuples,
|
||||
xlrec->flags);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0) && !isinit)
|
||||
if (XLogRecHasBlockData(record, 0) && !isinit)
|
||||
{
|
||||
appendStringInfoString(buf, ", offsets:");
|
||||
array_desc(buf, xlrec->offsets, sizeof(OffsetNumber),
|
||||
|
@ -62,7 +62,7 @@ btree_desc(StringInfo buf, XLogReaderState *record)
|
||||
appendStringInfo(buf, "ndeleted: %u, nupdated: %u",
|
||||
xlrec->ndeleted, xlrec->nupdated);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0))
|
||||
if (XLogRecHasBlockData(record, 0))
|
||||
delvacuum_desc(buf, XLogRecGetBlockData(record, 0, NULL),
|
||||
xlrec->ndeleted, xlrec->nupdated);
|
||||
break;
|
||||
@ -75,7 +75,7 @@ btree_desc(StringInfo buf, XLogReaderState *record)
|
||||
xlrec->snapshotConflictHorizon,
|
||||
xlrec->ndeleted, xlrec->nupdated);
|
||||
|
||||
if (!XLogRecHasBlockImage(record, 0))
|
||||
if (XLogRecHasBlockData(record, 0))
|
||||
delvacuum_desc(buf, XLogRecGetBlockData(record, 0, NULL),
|
||||
xlrec->ndeleted, xlrec->nupdated);
|
||||
break;
|
||||
|
@ -423,6 +423,8 @@ extern bool DecodeXLogRecord(XLogReaderState *state,
|
||||
((decoder)->record->blocks[block_id].has_image)
|
||||
#define XLogRecBlockImageApply(decoder, block_id) \
|
||||
((decoder)->record->blocks[block_id].apply_image)
|
||||
#define XLogRecHasBlockData(decoder, block_id) \
|
||||
((decoder)->record->blocks[block_id].has_data)
|
||||
|
||||
#ifndef FRONTEND
|
||||
extern FullTransactionId XLogRecGetFullXid(XLogReaderState *record);
|
||||
|
Loading…
x
Reference in New Issue
Block a user