From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix ordering issue with WAL operations in GIN fast insert path |
Date: | 2022-10-13 00:33:14 |
Message-ID: | E1oim9x-0027QQ-JQ@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix ordering issue with WAL operations in GIN fast insert path
Contrary to what is documented in src/backend/access/transam/README,
ginHeapTupleFastInsert() had a few ordering issues with the way it does
its WAL operations when inserting items in its fast path.
First, when using a separate list, XLogBeginInsert() was being always
called before START_CRIT_SECTION(), and in this case a second thing was
wrong when merging lists, as an exclusive lock was taken on the tail
page *before* calling XLogBeginInsert(). Finally, when inserting items
into a tail page, the order of XLogBeginInsert() and
START_CRIT_SECTION() was reversed. This commit addresses all these
issues by moving the calls of XLogBeginInsert() after all the pages
logged are locked and pinned, within a critical section.
Author: Matthias van de Meent, Zhang Mingli
Discussion: https://postgr.es/m/CAEze2WhL8uLMqynnnCu1LAPwxD5RKEo0nHV+eXGg_N6ELU88HQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/56b662523fd49f75abe89d5bad54d377b2f36c24
Modified Files
--------------
src/backend/access/gin/ginfast.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2022-10-13 00:50:21 | pgsql: Improve the WARNING message for CREATE SUBSCRIPTION. |
Previous Message | Michael Paquier | 2022-10-12 23:54:21 | pgsql: doc: Fix description of replication command CREATE_REPLICATION_S |