Avoid spurious wait in concurrent reindex

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: f9900df5f94936067e6fa24a9df609863eb08da2
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2021-01-15T13:31:42Z
Releases: 14.0
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@alvh.no-ip.org>
Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>
Reviewed-by: Hamid Akhtar <hamid.akhtar@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/20201130195439.GA24598@alvherre.pgsql

Files

PathChange+/−
src/backend/commands/indexcmds.c modified +47 −1
src/include/storage/proc.h modified +1 −0

Discussion