pgsql: Fix table lock levels for REINDEX INDEX CONCURRENTLY

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix table lock levels for REINDEX INDEX CONCURRENTLY
Date: 2019-05-08 12:32:53
Message-ID: E1hOLkj-0004oE-IV@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix table lock levels for REINDEX INDEX CONCURRENTLY

REINDEX CONCURRENTLY locks tables with ShareUpdateExclusiveLock rather
than the ShareLock used by a plain REINDEX. However,
RangeVarCallbackForReindexIndex() was not updated for that and still
used the ShareLock only. This would lead to lock upgrades later,
leading to possible deadlocks.

Reported-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://www.postgresql.org/message-id/flat/20190430151735.wi52sxjvxsjvaxxt%40alap3.anarazel.de

Branch
------
master

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

Modified Files
--------------
src/backend/commands/indexcmds.c | 45 +++++++++++++++++++++++++++++-----------
1 file changed, 33 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Oleg Bartunov 2019-05-08 12:45:34 Re: pgsql: docs: fist draft version of the PG 12 release notes
Previous Message Thomas Munro 2019-05-08 10:08:19 pgsql: Probe only 127.0.0.1 when looking for ports on Unix.