Fix two distinct errors in creation of GIN_INSERT_LISTPAGE xlog records.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Sep 2009 20:31:30 +0000 (20:31 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Sep 2009 20:31:30 +0000 (20:31 +0000)
commit9aed6a00d59ab6805fc00cd91d92cf3fc511d2be
tree9d23d132470dddd8b40579bea72a88664f1dce00
parent782fc2875252d76db634ddff00ef41a43b0b71ff
Fix two distinct errors in creation of GIN_INSERT_LISTPAGE xlog records.
In practice these mistakes were always masked when full_page_writes was on,
because XLogInsert would always choose to log the full page, and then
ginRedoInsertListPage wouldn't try to do anything.  But with full_page_writes
off a WAL replay failure was certain.

The GIN_INSERT_LISTPAGE record type could probably be eliminated entirely
in favor of using XLOG_HEAP_NEWPAGE, but I refrained from doing that now
since it would have required a significantly more invasive patch.

In passing do a little bit of code cleanup, including making the accounting
for free space on GIN list pages more precise.  (This wasn't a bug as the
errors were always in the conservative direction.)

Per report from Simon.  Back-patch to 8.4 which contains the identical code.
src/backend/access/gin/ginfast.c