Commit 817cb100 authored by Alvaro Herrera's avatar Alvaro Herrera

Fix new BRIN desummarize WAL record

The WAL-writing piece was forgetting to set the pages-per-range value.
Also, fix the declared type of struct member heapBlk, which I mistakenly
set as OffsetNumber rather than BlockNumber.

Problem was introduced by commit c655899b (April 1st).  Any system
that tries to replay the new WAL record written before this fix is
likely to die on replay and require pg_resetwal.

Reported by Tom Lane.
Discussion: https://postgr.es/m/20191.1491524824@sss.pgh.pa.us
parent 5c448847
......@@ -417,6 +417,7 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
xl_brin_desummarize xlrec;
XLogRecPtr recptr;
xlrec.pagesPerRange = revmap->rm_pagesPerRange;
xlrec.heapBlk = heapBlk;
xlrec.regOffset = regOffset;
......
......@@ -134,7 +134,7 @@ typedef struct xl_brin_desummarize
{
BlockNumber pagesPerRange;
/* page number location to set to invalid */
OffsetNumber heapBlk;
BlockNumber heapBlk;
/* offset of item to delete in regular index page */
OffsetNumber regOffset;
} xl_brin_desummarize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment