pgsql: Fix potential corruption of lock table in CREATE/DROP INDEX CONC

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix potential corruption of lock table in CREATE/DROP INDEX CONC
Дата
Msg-id E1TsiYd-0001Fd-80@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix potential corruption of lock table in CREATE/DROP INDEX CONCURRENTLY.

If VirtualXactLock() has to wait for a transaction that holds its VXID lock
as a fast-path lock, it must first convert the fast-path lock to a regular
lock.  It failed to take the required "partition" lock on the main
shared-memory lock table while doing so.  This is the direct cause of the
assert failure in GetLockStatusData() recently observed in the buildfarm,
but more worryingly it could result in arbitrary corruption of the shared
lock table if some other process were concurrently engaged in modifying the
same partition of the lock table.  Fortunately, VirtualXactLock() is only
used by CREATE INDEX CONCURRENTLY and DROP INDEX CONCURRENTLY, so the
opportunities for failure are fewer than they might have been.

In passing, improve some comments and be a bit more consistent about
order of operations.

Branch
------
master

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

Modified Files
--------------
src/backend/storage/lmgr/lock.c |   29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix typo
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix potential corruption of lock table in CREATE/DROP INDEX CONC