pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6a1ea02c491d16474a6214603dce40b5b122d4d1

Modified Files
--------------
src/backend/access/gin/ginbtree.c                  |  77 ++++++---
src/test/modules/Makefile                          |   4 +-
src/test/modules/gin/Makefile                      |  16 ++
.../modules/gin/expected/gin_incomplete_splits.out | 180 +++++++++++++++++++++
src/test/modules/gin/meson.build                   |  16 ++
src/test/modules/gin/sql/gin_incomplete_splits.sql | 144 +++++++++++++++++
src/test/modules/meson.build                       |   1 +
7 files changed, 418 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b899e00e716bf21c1858c5d07995882a44638ab2

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e43425f481542e4d5ef9c8fbdfe1759159b9f183

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f120c087242714499beb899329c3347add6200ae

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e74c916657b56e062e244be97ea17c57c178ade0

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix locking when fixing an incomplete split of a GIN internal pa
@ 2024-01-29 11:52 Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 6+ messages in thread

From: Heikki Linnakangas @ 2024-01-29 11:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix locking when fixing an incomplete split of a GIN internal page

ginFinishSplit() expects the caller to hold an exclusive lock on the
buffer, but when finishing an earlier "leftover" incomplete split of
an internal page, the caller held a shared lock. That caused an
assertion failure in MarkBufferDirty(). Without assertions, it could
lead to corruption if two backends tried to complete the split at the
same time.

On master, add a test case using the new injection point facility.

Report and analysis by Fei Changhong. Backpatch the fix to all
supported versions.

Reviewed-by: Fei Changhong, Michael Paquier
Discussion: https://www.postgresql.org/message-id/tencent_A3CE810F59132D8E230475A5F0F7A08C8307@qq.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e6511fe649c5ae6bb647258b634f3730cee3195b

Modified Files
--------------
src/backend/access/gin/ginbtree.c | 68 ++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2024-01-29 11:52 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>
2024-01-29 11:52 pgsql: Fix locking when fixing an incomplete split of a GIN internal pa Heikki Linnakangas <heikki.linnakangas@iki.fi>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox