postgresql/src/backend
Noah Misch 3cd9c3b921 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:38 -07:00
..
access Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:38 -07:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Fix corruption of pg_shdepend when copying deps from template database 2021-10-21 10:39:01 +09:00
commands Ensure correct lock level is used in ALTER ... RENAME 2021-10-19 19:08:45 -03:00
executor Fix assignment to array of domain over composite. 2021-10-19 13:54:45 -04:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Track LLVM 14 API changes. 2021-09-27 10:53:20 +13:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq shm_mq: Update mq_bytes_written less often. 2021-10-14 16:13:36 -04:00
main process startup: Split single user code out of PostgresMain(). 2021-09-17 19:56:47 -07:00
nodes Improve order in file 2021-10-07 08:20:55 +02:00
optimizer Fix planner error with pulling up subquery expressions into function RTEs. 2021-10-14 12:43:55 -04:00
parser Remove bogus assertion in transformExpressionList(). 2021-10-19 11:35:15 -04:00
partitioning Fix duplicate words in comments 2021-10-04 15:12:57 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Treat ETIMEDOUT as indicating a non-recoverable connection failure. 2021-09-30 14:16:08 -04:00
postmaster Make autovacuum launcher more responsive to pg_log_backend_memory_contexts(). 2021-10-12 09:50:17 +09:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Reset properly snapshot export state during transaction abort 2021-10-18 11:55:42 +09:00
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
storage Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:38 -07:00
tcop Fix Portal snapshot tracking to handle subtransactions properly. 2021-10-01 11:10:12 -04:00
tsearch Clean up more code using "(expr) ? true : false" 2021-10-11 09:36:42 +09:00
utils Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:38 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00