postgresql/src/backend/utils
Noah Misch df6158139f Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions.
The purpose of commit 8a54e12a38 was to
fix this, and it sufficed when the PREPARE TRANSACTION completed before
the CIC looked for lock conflicts.  Otherwise, things still broke.  As
before, in a cluster having used CIC while having enabled prepared
transactions, queries that use the resulting index can silently fail to
find rows.  It may be necessary to reindex to recover from past
occurrences; REINDEX CONCURRENTLY suffices.  Fix this for future index
builds by making CIC wait for arbitrarily-recent prepared transactions
and for ordinary transactions that may yet PREPARE TRANSACTION.  As part
of that, have PREPARE TRANSACTION transfer locks to its dummy PGPROC
before it calls ProcArrayClearTransaction().  Back-patch to 9.6 (all
supported versions).

Andrey Borodin, reviewed (in earlier versions) by Andres Freund.

Discussion: https://postgr.es/m/01824242-AA92-4FE9-9BA7-AEBAFFEA3D0C@yandex-team.ru
2021-10-23 18:36:43 -07:00
..
adt Fix corner-case loss of precision in numeric_power(). 2021-10-06 13:22:33 +01:00
cache Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:43 -07:00
error Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:44 -05:00
fmgr Fix broken ruleutils support for function TRANSFORM clauses. 2021-01-25 13:03:11 -05:00
hash Allow memory contexts to have both fixed and variable ident strings. 2018-03-27 16:46:51 -04:00
init Fix postmaster's behavior during smart shutdown. 2020-08-14 13:26:57 -04:00
mb Avoid unnecessary out-of-memory errors during encoding conversion. 2019-10-03 17:34:25 -04:00
misc Set pg_setting.pending_restart when pertinent config lines are removed 2021-07-27 15:44:12 -04:00
mmgr Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
resowner Basic JIT provider and error handling infrastructure. 2018-03-21 19:28:28 -07:00
sort Robustify tuplesort's free_sort_tuple function 2021-07-13 13:31:00 +12:00
time Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
errcodes.txt Make new error code name match SQL standard more closely 2018-06-11 11:15:28 -04:00
Gen_dummy_probes.pl Clean up some perlcritic warnings 2018-05-07 15:35:32 -04:00
Gen_dummy_probes.sed Update copyright for 2018 2018-01-02 23:30:12 -05:00
Gen_fmgrtab.pl Assorted minor cleanups for bootstrap-data Perl scripts. 2018-05-19 16:04:47 -04:00
generate-errcodes.pl Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Suppress compiler warnings when building with --enable-dtrace. 2018-05-07 13:44:09 -04:00
probes.d Support parallel btree index builds. 2018-02-02 13:32:44 -05:00