pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Erik Jones <ejones@engineyard.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Duplicate key existant/index visibility bug in 9.3.3
Date: Mon, 26 Jan 2015 17:19:23 -0500
Message-ID: <17148.1422310763@sss.pgh.pa.us> (raw)
In-Reply-To: <D43A52C1-79DD-4621-B7D2-B21BF66DB2C2@engineyard.com>
References: <D43A52C1-79DD-4621-B7D2-B21BF66DB2C2@engineyard.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Erik Jones <ejones@engineyard.com> writes:
> Today I had a client report an issue restoring a dump made from their
production db on a testing server wherein there existed two rows for a
table with identical primary key values.

FWIW, the simplest explanation for this situation is corruption in your
primary key index.  That's necessary to explain the rows not being visible
through an indexscan, and it's probably sufficient to explain how two rows
with the same pkey managed to get in without a unique-index failure.

So what I'd suggest is getting rid of whichever row you don't want (DELETE
WHERE ctid = something is the best way) and then doing a REINDEX on that
index.  Now, the REINDEX is going to lock out updates on the table, so
it's not a zero-downtime solution ... but it's surely better than a dump
and reload.

You should definitely also update to 9.3.5 (or next week, 9.3.6) ASAP.
Even if this specific problem isn't fixed, there's a bunch of things
that *are* fixed and will eventually bite you.  9.3.X has not been
one of our most stable release branches :-(

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (8+ messages)  latest in thread

Message-ID: <17148.1422310763@sss.pgh.pa.us>
Permalink:  ../17148.1422310763@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17148.1422310763@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ejones@engineyard.com
  Subject: Re: Duplicate key existant/index visibility bug in 9.3.3
  In-Reply-To: <17148.1422310763@sss.pgh.pa.us>
  References: <D43A52C1-79DD-4621-B7D2-B21BF66DB2C2@engineyard.com> <17148.1422310763@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox