mirror of
https://github.com/postgres/postgres.git
synced 2025-11-25 12:03:53 +03:00
Fix parallel operations that prevent oldest xmin from advancing.
While determining xid horizons, we skip over backends that are running Vacuum. We also ignore Create Index Concurrently, or Reindex Concurrently for the purposes of computing Xmin for Vacuum. But we were not setting the flags corresponding to these operations when they are performed in parallel which was preventing Xid horizon from advancing. The optimization related to skipping Create Index Concurrently, or Reindex Concurrently operations was implemented in PG-14 but the fix is the same for the Parallel Vacuum as well so back-patched till PG-13. Author: Masahiko Sawada Reviewed-by: Amit Kapila Backpatch-through: 13 Discussion: https://postgr.es/m/CAD21AoCLQqgM1sXh9BrDFq0uzd3RBFKi=Vfo6cjjKODm0Onr5w@mail.gmail.com
This commit is contained in:
@@ -65,6 +65,13 @@ struct XidCache
|
||||
#define PROC_VACUUM_STATE_MASK \
|
||||
(PROC_IN_VACUUM | PROC_IN_SAFE_IC | PROC_VACUUM_FOR_WRAPAROUND)
|
||||
|
||||
/*
|
||||
* Flags that are valid to copy from another proc, the parallel leader
|
||||
* process in practice. Currently, flags that are set during parallel
|
||||
* vacuum and parallel index creation are allowed.
|
||||
*/
|
||||
#define PROC_COPYABLE_FLAGS (PROC_IN_VACUUM | PROC_IN_SAFE_IC)
|
||||
|
||||
/*
|
||||
* We allow a small number of "weak" relation locks (AccessShareLock,
|
||||
* RowShareLock, RowExclusiveLock) to be recorded in the PGPROC structure
|
||||
|
||||
Reference in New Issue
Block a user