postgresql/src/backend
Alvaro Herrera e28bb88519
Revert changes to CONCURRENTLY that "sped up" Xmin advance
This reverts commit d9d076222f "VACUUM: ignore indexing operations
with CONCURRENTLY".

These changes caused indexes created with the CONCURRENTLY option to
miss heap tuples that were HOT-updated and HOT-pruned during the index
creation.  Before these changes, HOT pruning would have been prevented
by the Xmin of the transaction creating the index, but because this
change was precisely to allow the Xmin to move forward ignoring that
backend, now other backends scanning the table can prune them.  This is
not a problem for VACUUM (which requires a lock that conflicts with a
CREATE INDEX CONCURRENTLY operation), but HOT-prune can definitely
occur.  In other words, Xmin advancement was sped up, but at the cost of
corrupting the resulting index.

Regrettably, this means that the new feature in PG14 that RIC/CIC on
very large tables no longer force VACUUM to retain very old tuples goes
away.  We might try to implement it again in a later release, but for
now the risk of indexes missing tuples is too high and there's no easy
fix.

Backpatch to 14, where this change appeared.

Reported-by: Peter Slavov <pet.slavov@gmail.com>
Diagnosys-by: Andrey Borodin <x4mmm@yandex-team.ru>
Diagnosys-by: Michael Paquier <michael@paquier.xyz>
Diagnosys-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/17485-396609c6925b982d%40postgresql.org
2022-05-31 21:24:59 +02:00
..
access Fix typo in hash README. 2022-05-31 14:37:41 +05:30
bootstrap Indent C code in flex and bison files 2022-05-13 07:17:29 +02:00
catalog Extend pg_publication_tables to display column list and row filter. 2022-05-19 08:20:55 +05:30
commands Fix COPY FROM when database encoding is SQL_ASCII. 2022-05-29 23:54:25 +03:00
executor Avoid overflow hazard when clamping group counts to "long int". 2022-05-21 13:13:44 -04:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
lib Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
libpq Remove misguided SSL key file ownership check in libpq. 2022-05-26 14:14:05 -04:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Rename JsonIsPredicate.value_type, fix JSON backend/nodes/ infrastructure. 2022-05-13 11:40:08 -04:00
optimizer Teach remove_unused_subquery_outputs about window run conditions 2022-05-27 10:37:58 +12:00
parser Make STRING an unreserved_keyword. 2022-05-30 14:05:20 -04:00
partitioning Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
po Translation updates 2022-05-16 11:12:42 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Add a new shmem_request_hook hook. 2022-05-13 09:31:06 -04:00
regex Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
replication Extend pg_publication_tables to display column list and row filter. 2022-05-19 08:20:55 +05:30
rewrite Fix incautious CTE matching in rewriteSearchAndCycle(). 2022-04-23 12:16:12 -04:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
storage Revert changes to CONCURRENTLY that "sped up" Xmin advance 2022-05-31 21:24:59 +02:00
tcop Fix DDL deparse of CREATE OPERATOR CLASS 2022-05-20 18:52:55 +02:00
tsearch Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
utils Ensure ParseTzFile() closes the input file after failing. 2022-05-31 14:47:44 -04:00
.gitignore
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
common.mk
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00