aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-11-25 13:58:59 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-11-25 13:58:59 -0500
commit877b67c38b946dcbf70fe11736bdde841e4c826b (patch)
treefdc2d8ff352e18eeecb8a4515214c5f7515e001b
parented0b409d22346b1b027a4c2099ca66984d94b6dd (diff)
downloadpostgresql-877b67c38b946dcbf70fe11736bdde841e4c826b.tar.gz
postgresql-877b67c38b946dcbf70fe11736bdde841e4c826b.zip
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.
-rw-r--r--src/backend/access/gin/ginxlog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/access/gin/ginxlog.c b/src/backend/access/gin/ginxlog.c
index 01297c36092..e67a0aab195 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++;
}
/*