pgsql: Correct predicate locking for DROP INDEX CONCURRENTLY.

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема pgsql: Correct predicate locking for DROP INDEX CONCURRENTLY.
Дата
Msg-id E1TQ3j4-0004Fh-Dc@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Correct predicate locking for DROP INDEX CONCURRENTLY.

For the non-concurrent case there is an AccessExclusiveLock lock
on both the index and the heap at a time during which no other
process is using either, before which the index is maintained and
used for scans, and after which the index is no longer used or
maintained.  Predicate locks can safely be moved from the index to
the related heap relation under the protection of these locks.
This was done prior to the introductin of DROP INDEX CONCURRENTLY
and continues to be done for non-concurrent index drops.

For concurrent index drops, the predicate locks must be moved when
there are no index scans in progress on that index and no more can
subsequently start, and before heap inserts stop maintaining the
index.  As long as these conditions are guaranteed when the
TransferPredicateLocksToHeapRelation() function is called,
stronger locks are not needed for correctness.

Kevin Grittner based on questions by Tom Lane in reviewing the
DROP INDEX CONCURRENTLY patch and in cooperation with Andres
Freund and Simon Riggs.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4c9d0901f135d724a9f3cfa4140a5afd44b10f08

Modified Files
--------------
src/backend/catalog/index.c |   28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix pg_dump's handling of DROP DATABASE commands in --clean mode
Следующее
От: Kevin Grittner
Дата:
Сообщение: pgsql: Correct predicate locking for DROP INDEX CONCURRENTLY.