Re: [COMMITTERS] pgsql: Account for catalog snapshot in PGXACT->xmin updates.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Account for catalog snapshot in PGXACT->xmin updates.
Date: 2016-12-06 14:46:46
Message-ID: CA+TgmoahWDm-7fperBxzU9uZ99LPMUmEpSXLTw9TmrOgzwnORw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Nov 15, 2016 at 3:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Account for catalog snapshot in PGXACT->xmin updates.
>
> The CatalogSnapshot was not plugged into SnapshotResetXmin()'s accounting
> for whether MyPgXact->xmin could be cleared or advanced. In normal
> transactions this was masked by the fact that the transaction snapshot
> would be older, but during backend startup and certain utility commands
> it was possible to re-use the CatalogSnapshot after MyPgXact->xmin had
> been cleared, meaning that recently-deleted rows could be pruned even
> though this snapshot could still see them, causing unexpected catalog
> lookup failures. This effect appears to be the explanation for a recent
> failure on buildfarm member piculet.
>
> To fix, add the CatalogSnapshot to the RegisteredSnapshots heap whenever
> it is valid.

It seems to me that this makes it possible for
ThereAreNoPriorRegisteredSnapshots() to fail spuriously. The only
core code that calls that function is in copy.c, and apparently we
never reach that point with the catalog snapshot set. But that seems
fragile.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2016-12-06 15:12:37 pgsql: Bump catversion for restrictive RLS changes
Previous Message Fujii Masao 2016-12-06 08:09:52 pgsql: Improve documentation about pg_stat_replication view.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-12-06 14:56:44 Re: PSQL commands: \quit_if, \quit_unless
Previous Message Asif Naeem 2016-12-06 14:42:21 Re: pgcrypto compilation error due to stack-allocated EVP_CIPHER_CTX