Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 817cb10

Browse files
committed
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 c655899 (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
1 parent 5c44884 commit 817cb10

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/backend/access/brin/brin_revmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ brinRevmapDesummarizeRange(Relation idxrel, BlockNumber heapBlk)
417417
xl_brin_desummarize xlrec;
418418
XLogRecPtr recptr;
419419

420+
xlrec.pagesPerRange = revmap->rm_pagesPerRange;
420421
xlrec.heapBlk = heapBlk;
421422
xlrec.regOffset = regOffset;
422423

src/include/access/brin_xlog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ typedef struct xl_brin_desummarize
134134
{
135135
BlockNumber pagesPerRange;
136136
/* page number location to set to invalid */
137-
OffsetNumber heapBlk;
137+
BlockNumber heapBlk;
138138
/* offset of item to delete in regular index page */
139139
OffsetNumber regOffset;
140140
} xl_brin_desummarize;

0 commit comments

Comments
 (0)