Re: Corruption with duplicate primary key

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Alex Adriaanse <alex(at)oseberg(dot)io>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Corruption with duplicate primary key
Date: 2019-12-05 23:34:37
Message-ID: CAH2-Wzn1eAuiQZF3Na_C4bCZeGfU-4v+XC-3XqDbVByp4sdTvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 5, 2019 at 1:14 PM Alex Adriaanse <alex(at)oseberg(dot)io> wrote:
> We have a Postgres 10 database that we recently upgraded to Postgres 12 using pg_upgrade. We recently discovered that there are rows in one of the tables that have duplicate primary keys:

What's the timeline here? In other words, does it look like these rows
were updated and/or deleted before, around the same time as, or after
the upgrade?

The symptoms you report seem fairly generic to me, at least at first
blush. They could be caused by storage level inconsistencies that
could have many causes.

> This database runs inside Docker, with the data directory bind-mounted to a reflink-enabled XFS filesystem. The VM is running Debian's 4.19.16-1~bpo9+1 kernel inside an AWS EC2 instance. We have Debezium stream data from this database via pgoutput.

That seems suspicious, since reflink support for XFS is rather immature.

How did you invoke pg_upgrade? Did you use the --link (hard link) option?

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-12-05 23:41:24 Re: [Proposal] Level4 Warnings show many shadow vars
Previous Message Tom Lane 2019-12-05 23:17:49 Re: Runtime pruning problem