pgsql: Get rid of the post-recovery cleanup step of GIN page splits.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Get rid of the post-recovery cleanup step of GIN page splits.
Дата
Msg-id E1VliqG-0007V3-ET@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/631118fe1e8f66fd15eb0013dd9940d9146a5096

Modified Files
--------------
src/backend/access/gin/ginbtree.c     |  447 +++++++++++++++++++++---------
src/backend/access/gin/gindatapage.c  |   91 ++-----
src/backend/access/gin/ginentrypage.c |   74 ++---
src/backend/access/gin/ginxlog.c      |  479 ++++++++++++++-------------------
src/backend/access/rmgrdesc/gindesc.c |   45 +++-
src/include/access/gin.h              |    1 -
src/include/access/gin_private.h      |   81 ++++--
src/include/access/rmgrlist.h         |    2 +-
src/include/access/xlog_internal.h    |    2 +-
9 files changed, 666 insertions(+), 556 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: More GIN refactoring.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Minor corrections in lmgr/README.