]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Revert "Get rid of WALBufMappingLock" master github/master
authorAlexander Korotkov <akorotkov@postgresql.org>
Fri, 22 Aug 2025 15:44:39 +0000 (18:44 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Fri, 22 Aug 2025 16:26:38 +0000 (19:26 +0300)
commitc13070a27b63d9ce4850d88a63bf889a6fde26f0
tree11fcb0a227de116687a253897150f857f2693bf2
parentb63952a7811319a6525a9ea23afa294a900fa895
Revert "Get rid of WALBufMappingLock"

This reverts commit bc22dc0e0ddc2dcb6043a732415019cc6b6bf683.
It appears that conditional variables are not suitable for use inside
critical sections.  If WaitLatch()/WaitEventSetWaitBlock() face postmaster
death, they exit, releasing all locks instead of PANIC.  In certain
situations, this leads to data corruption.

Reported-by: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/B3C69B86-7F82-4111-B97F-0005497BB745%40yandex-team.ru
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Yura Sokolov <y.sokolov@postgrespro.ru>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Backpatch-through: 18
src/backend/access/transam/xlog.c
src/backend/utils/activity/wait_event_names.txt
src/include/storage/lwlocklist.h