pgsql: Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.
Дата
Msg-id E1YsQuR-0001Bv-C5@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.

Commit 81c45081 introduced a new RBM_ZERO_AND_LOCK mode to ReadBuffer, which
takes a lock on the buffer before zeroing it. However, you cannot take a
lock on a local buffer, and you got a segfault instead. The version of that
patch committed to master included a check for !isLocalBuf, and therefore
didn't crash, but oddly I missed that in the back-patched versions. This
patch adds that check to the back-branches too.

RBM_ZERO_AND_LOCK mode is only used during WAL replay, and in hash indexes.
WAL replay only deals with shared buffers, so the only way to trigger the
bug is with a temporary hash index.

Reported by Artem Ignatyev, analysis by Tom Lane.

Branch
------
REL9_0_STABLE

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

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgsql: Additional functions and operators for jsonb