Fix parallel operations that prevent oldest xmin from advancing.
authorAmit Kapila <akapila@postgresql.org>
Fri, 19 Nov 2021 03:54:00 +0000 (09:24 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 19 Nov 2021 03:54:00 +0000 (09:24 +0530)
commit33b6dd83e26f06c96e7d54af534a70476749cbab
treeb1c5fe0ec36e43075472e3a31f6f9ec69842c015
parent77c8892a1989d91d8f1c9eb988b3c27ddad0ea07
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
src/backend/access/heap/vacuumlazy.c
src/backend/storage/ipc/procarray.c
src/include/storage/proc.h