summaryrefslogtreecommitdiff
path: root/src/include/storage/proc.h
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2021-11-19 09:24:00 +0530
committerAmit Kapila <akapila@postgresql.org>2021-11-19 09:24:00 +0530
commit33b6dd83e26f06c96e7d54af534a70476749cbab (patch)
treeb1c5fe0ec36e43075472e3a31f6f9ec69842c015 /src/include/storage/proc.h
parent77c8892a1989d91d8f1c9eb988b3c27ddad0ea07 (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 1ee9000b2b9..b3ea1a25860 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -63,6 +63,13 @@ struct XidCache
(PROC_IN_VACUUM | PROC_IN_ANALYZE | PROC_VACUUM_FOR_WRAPAROUND)
/*
+ * Flags that are valid to copy from another proc, the parallel leader
+ * process in practice. Currently, a flag that is set during parallel
+ * vacuum is allowed.
+ */
+#define PROC_COPYABLE_FLAGS (PROC_IN_VACUUM)
+
+/*
* 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