pgsql: Avoid spurious wait in concurrent reindex

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid spurious wait in concurrent reindex
Date: 2021-01-15 13:34:39
Message-ID: E1l0PFP-0007R3-Oj@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid spurious wait in concurrent reindex

This is like commit c98763bf51bf, but for REINDEX CONCURRENTLY. To wit:
this flags indicates that the current process is safe to ignore for the
purposes of waiting for other snapshots, when doing CREATE INDEX
CONCURRENTLY and REINDEX CONCURRENTLY. This helps two processes doing
either of those things not deadlock, and also avoids spurious waits.

Author: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Reviewed-by: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Reviewed-by: Hamid Akhtar <hamid(dot)akhtar(at)gmail(dot)com>
Reviewed-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Discussion: https://postgr.es/m/20201130195439.GA24598@alvherre.pgsql

Branch
------
master

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

Modified Files
--------------
src/backend/commands/indexcmds.c | 48 +++++++++++++++++++++++++++++++++++++++-
src/include/storage/proc.h | 1 +
2 files changed, 48 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-01-15 16:30:20 pgsql: Improve our heuristic for selecting PG_SYSROOT on macOS.
Previous Message Fujii Masao 2021-01-15 03:46:37 pgsql: Fix calculation of how much shared memory is required to store a