pgsql: Fix double-XLogBeginInsert call in GIN page splits.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix double-XLogBeginInsert call in GIN page splits.
Дата
Msg-id E1Z9I5T-00064P-L8@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix double-XLogBeginInsert call in GIN page splits.

If data checksums or wal_log_hints is on, and a GIN page is split, the code
to find a new, empty, block was called after having already called
XLogBeginInsert(). That causes an assertion failure or PANIC, if finding the
new block involves updating a FSM page that had not been modified since last
checkpoint, because that update is WAL-logged, which calls XLogBeginInsert
again. Nested XLogBeginInsert calls are not supported.

To fix, rearrange GIN code so that XLogBeginInsert is called later, after
finding the victim buffers.

Reported by Jeff Janes.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a45c70acf35e43257d86313dcbb7bb0e5201fab1

Modified Files
--------------
src/backend/access/gin/ginbtree.c     |   15 ++++++---------
src/backend/access/gin/gindatapage.c  |    4 ++++
src/backend/access/gin/ginentrypage.c |    1 +
3 files changed, 11 insertions(+), 9 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Don't choke on files that are removed while pg_rewind runs.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Promote the assertion that XLogBeginInsert() is not called twice