Re: XID-assigned idle transactions affect vacuum's job.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: XID-assigned idle transactions affect vacuum's job.
Date: 2018-03-20 14:36:15
Message-ID: 11866.1521556575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> writes:
> I think that to decide which deleted tuples must be preserved we don't
> need to care about backend PGXACT.xid but must care about PGXACT.xmin.

Surely this is wrong? Assume that the XID in question is the oldest one
visible in the ProcArray (if it isn't, the question is moot anyway).
If we ignore it while setting VACUUM's cutoff, then if we come to a
tuple bearing that XID, we will think the transaction involved is
aborted (since it's not marked as committed) and proceed to remove the
tuple.

As Amit remarks, the fact that that XID will constrain the XMINs of other
open transactions means you'd usually not get any win anyway. But AFAICS,
this proposal is incorrect even without that.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-20 14:37:36 pgsql: Fix CommandCounterIncrement in partition-related DDL
Previous Message Christoph Berg 2018-03-20 14:31:41 Re: [PoC PATCH] Parallel dump to /dev/null