Re: Parallel vacuum workers prevent the oldest xmin from advancing

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel vacuum workers prevent the oldest xmin from advancing
Date: 2021-10-06 16:43:05
Message-ID: DE1687F4-3F66-438A-B4D4-9D3EC2A9A45D@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/6/21, 12:13 AM, "Masahiko Sawada" <sawada(dot)mshk(at)gmail(dot)com> wrote:
> A customer reported that during parallel index vacuum, the oldest xmin
> doesn't advance. Normally, the calculation of oldest xmin
> (ComputeXidHorizons()) ignores xmin/xid of processes having
> PROC_IN_VACUUM flag in MyProc->statusFlags. But since parallel vacuum
> workers don’t set their statusFlags, the xmin of the parallel vacuum
> worker is considered to calculate the oldest xmin. This issue happens
> from PG13 where the parallel vacuum was introduced. I think it's a
> bug.

+1

> To fix it, I thought that we change the create index code and the
> vacuum code so that the individual parallel worker sets its status
> flags according to the leader’s one. But ISTM it’d be better to copy
> the leader’s status flags to workers in ParallelWorkerMain(). I've
> attached a patch for HEAD.

The patch seems reasonable to me.

Nathan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-10-06 16:47:54 Re: Running tests under valgrind is getting slower at an alarming pace
Previous Message Bossart, Nathan 2021-10-06 16:31:42 Re: Pre-allocating WAL files