postgres.git / summary / log / commit / refs

commit    9b60e40cad723cf904ebd5d4afa5ecd40431534a
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Nov 25 18:58:59 2011 +0000
First released in: 9.2.0, 8.4.10, 9.0.6, 9.1.2

    Fix erroneous replay of GIN_UPDATE_META_PAGE WAL records.
    
    A simple thinko in ginRedoUpdateMetapage, namely failing to increment a
    loop counter, led to inserting records into the last pending-list page in
    the wrong order (the opposite of that intended).  So far as I can tell,
    this would not upset the code that eventually flushes pending items into
    the main part of the GIN index.  But it did break the code that searched
    the pending list for matches, resulting in transient failure to find
    matching entries during index lookups, as illustrated in bug #6307 from
    Maksym Boguk.
    
    Back-patch to 8.4 where the incorrect code was introduced.


src/backend/access/gin/ginxlog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/access/gin/ginxlog.c b/src/backend/access/gin/ginxlog.c index 143a9e09e32..864cab28fd0 100644 --- a/src/backend/access/gin/ginxlog.c +++ b/src/backend/access/gin/ginxlog.c @@ -528,6 +528,8 @@ ginRedoUpdateMetapage(XLogRecPtr lsn, XLogRecord *record) elog(ERROR, "failed to add item to index page"); tuples = (IndexTuple) (((char *) tuples) + tupsize); + + off++; } /* [parent: af7b787aad06]