git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c02d48)
Fix BRIN xlog replay
2015年6月26日 21:13:05 +0000 (18:13 -0300)
2015年6月26日 21:13:05 +0000 (18:13 -0300)
There was a confusion about which block number to use when storing an
item's pointer in the revmap -- the revmap page's blkno was being used,
not the data page's blkno.

Spotted-by: Jeff Janes

diff --git a/src/backend/access/brin/brin_xlog.c b/src/backend/access/brin/brin_xlog.c
index 49261aa1f160ed40cf007f95a199a77137defaee..09001552920b552e1dfb2f8b6020a041ab4efe19 100644 (file)
--- a/src/backend/access/brin/brin_xlog.c
+++ b/src/backend/access/brin/brin_xlog.c
@@ -47,6 +47,7 @@ brin_xlog_insert_update(XLogReaderState *record,
{
XLogRecPtr lsn = record->EndRecPtr;
Buffer buffer;
+ BlockNumber regpgno;
Page page;
XLogRedoAction action;
@@ -66,6 +67,9 @@ brin_xlog_insert_update(XLogReaderState *record,
action = XLogReadBufferForRedo(record, 0, &buffer);
}
+ /* need this page's blkno to store in revmap */
+ regpgno = BufferGetBlockNumber(buffer);
+
/* insert the index item into the page */
if (action == BLK_NEEDS_REDO)
{
@@ -97,9 +101,8 @@ brin_xlog_insert_update(XLogReaderState *record,
if (action == BLK_NEEDS_REDO)
{
ItemPointerData tid;
- BlockNumber blkno = BufferGetBlockNumber(buffer);
- ItemPointerSet(&tid, blkno, xlrec->offnum);
+ ItemPointerSet(&tid, regpgno, xlrec->offnum);
page = (Page) BufferGetPage(buffer);
brinSetHeapBlockItemptr(buffer, xlrec->pagesPerRange, xlrec->heapBlk,
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /