summaryrefslogtreecommitdiff
path: root/src/include/storage/proc.h
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2021-11-19 09:14:09 +0530
committerAmit Kapila <akapila@postgresql.org>2021-11-19 09:14:09 +0530
commitead49ebc07a7eaae4d57008dd7fd1f3d71fa1ec4 (patch)
treef9ccacc637ded2ef9041036770a900c233883f57 /src/include/storage/proc.h
parented1c261a00e51f7f216911df2278827ba8cc211f (diff)
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
Diffstat (limited to 'src/include/storage/proc.h')
-rw-r--r--src/include/storage/proc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index be67d8a8616..cfabfdbedf1 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -66,6 +66,13 @@ struct XidCache
(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
* rather than the main lock table. This eases contention on the lock