]> granicus.if.org Git - postgresql/commit
Get rid of the post-recovery cleanup step of GIN page splits.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 27 Nov 2013 17:21:23 +0000 (19:21 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 27 Nov 2013 17:21:23 +0000 (19:21 +0200)
commit631118fe1e8f66fd15eb0013dd9940d9146a5096
treebff4834fef6fe4726a76babd324fc8a6ec5c5994
parentce5326eed386959aac7a322880896ddeade7fd52
Get rid of the post-recovery cleanup step of GIN page splits.

Replace it with an approach similar to what GiST uses: when a page is split,
the left sibling is marked with a flag indicating that the parent hasn't been
updated yet. When the parent is updated, the flag is cleared. If an insertion
steps on a page with the flag set, it will finish split before proceeding
with the insertion.

The post-recovery cleanup mechanism was never totally reliable, as insertion
to the parent could fail e.g because of running out of memory or disk space,
leaving the tree in an inconsistent state.

This also divides the responsibility of WAL-logging more clearly between
the generic ginbtree.c code, and the parts specific to entry and posting
trees. There is now a common WAL record format for insertions and deletions,
which is written by ginbtree.c, followed by tree-specific payload, which is
returned by the placetopage- and split- callbacks.
src/backend/access/gin/ginbtree.c
src/backend/access/gin/gindatapage.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/ginxlog.c
src/backend/access/rmgrdesc/gindesc.c
src/include/access/gin.h
src/include/access/gin_private.h
src/include/access/rmgrlist.h
src/include/access/xlog_internal.h