From 042b584c7f7d6216c54359c0ee0f613ba3b3d9c2 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 31 May 2022 21:24:59 +0200 Subject: Revert changes to CONCURRENTLY that "sped up" Xmin advance This reverts commit d9d076222f5b "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 Diagnosys-by: Andrey Borodin Diagnosys-by: Michael Paquier Diagnosys-by: Andres Freund Discussion: https://postgr.es/m/17485-396609c6925b982d%40postgresql.org --- doc/src/sgml/ref/create_index.sgml | 2 -- doc/src/sgml/ref/reindex.sgml | 2 -- 2 files changed, 4 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index 11179f0b9d9..df45bc97466 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -845,8 +845,6 @@ Indexes: Like any long-running transaction, CREATE INDEX on a table can affect which tuples can be removed by concurrent VACUUM on any other table. - Excepted from this are operations with the CONCURRENTLY - option for indexes that are not partial and do not index any expressions. diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml index e6b25ee670f..22dbb520d52 100644 --- a/doc/src/sgml/ref/reindex.sgml +++ b/doc/src/sgml/ref/reindex.sgml @@ -470,8 +470,6 @@ Indexes: Like any long-running transaction, REINDEX on a table can affect which tuples can be removed by concurrent VACUUM on any other table. - Excepted from this are operations with the CONCURRENTLY - option for indexes that are not partial and do not index any expressions. -- cgit v1.2.3