]> granicus.if.org Git - postgresql/commit
Fix assorted bugs in GIN's WAL replay logic.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Oct 2010 23:04:59 +0000 (19:04 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 11 Oct 2010 23:04:59 +0000 (19:04 -0400)
commit2afd044c9491c484d0b2b6910b17896a64a08c01
treef5713f015b73f54eac56fc559acde6d26fcd669f
parent10a829dea87c0378b68833d016de639d6605db94
Fix assorted bugs in GIN's WAL replay logic.

The original coding was quite sloppy about handling the case where
XLogReadBuffer fails (because the page has since been deleted).  This
would result in either "bad buffer id: 0" or an Assert failure during
replay, if indeed the page were no longer there.  In a couple of places
it also neglected to check whether the change had already been applied,
which would probably result in corrupted index contents.  I believe that
bug #5703 is an instance of the first problem.  These issues could show up
without replication, but only if you were unfortunate enough to crash
between modification of a GIN index and the next checkpoint.

Back-patch to 8.2, which is as far back as GIN has WAL support.
src/backend/access/gin/ginxlog.c