pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Maciek Sakrejda <maciek@heroku.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8656: Duplicate data violating unique constraints
Date: Tue, 10 Dec 2013 02:10:42 +0100
Message-ID: <20131210011042.GF27840@awork2.anarazel.de> (raw)
In-Reply-To: <CAKwe89BX1KKxjjUMDRdf2ybC_7mFLBTsVKZDjO+nAUp170rmsg@mail.gmail.com>
References: <E1VoIgB-0005Ok-3X@wrigleys.postgresql.org>
	<20131205013307.GC8935@awork2.anarazel.de>
	<CAKwe89A0HjOZRpZuqj70zF1QvmOxTcALNEL=a6AQdQTe+dzGKQ@mail.gmail.com>
	<20131205091529.GD28793@alap2.anarazel.de>
	<CAKwe89DbQDkP9iFGesGhHH1qWiWogca2PE36DT_Ya10Cn6f1Eg@mail.gmail.com>
	<20131206100751.GJ7814@awork2.anarazel.de>
	<CAKwe89BX1KKxjjUMDRdf2ybC_7mFLBTsVKZDjO+nAUp170rmsg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2013-12-06 09:23:59 -0800, Maciek Sakrejda wrote:
> => with affected_pages as (
>   select distinct regexp_replace(ctid::text, '\((\d+),\d+\)', '\1') as page
>   from post where id in (select id from post group by id having count(*) >
> 1)
> ) select * from affected_pages, page_header(get_raw_page('post',
> page::integer));
>  page  |     lsn     | checksum | flags | lower | upper | special |
> pagesize | version | prune_xid
> -------+-------------+----------+-------+-------+-------+---------+----------+---------+-----------
>  28192 | 12/1B004250 |    -1751 |     1 |   304 |  1712 |    8192 |
> 8192 |       4 |         0
>  28194 | 12/1D1304D8 |    10886 |     1 |   316 |  1352 |    8192 |
> 8192 |       4 |         0
>  28203 | 12/BE2BDF8  |   -12970 |     0 |   284 |  1592 |    8192 |
> 8192 |       4 |         0
>  28204 | 12/BE2DDE0  |     1235 |     0 |   284 |   392 |    8192 |
> 8192 |       4 |         0
>  28281 | 12/BE33218  |    -7837 |     0 |   284 |   392 |    8192 |
> 8192 |       4 |         0
>  28390 | 12/BE4CF70  |   -20573 |     0 |   284 |   392 |    8192 |
> 8192 |       4 |         0
>  28392 | 12/1D135E78 |    -8032 |     1 |   300 |   992 |    8192 |
> 8192 |       4 |         0
>  28410 | 12/BE67610  |    23108 |     0 |   284 |   872 |    8192 |
> 8192 |       4 |         0
>  28561 | 12/1D164030 |   -24596 |     0 |   284 |   392 |    8192 |
> 8192 |       4 |         0
> (9 rows)
> 
> => with affected_pages as (
>   select distinct regexp_replace(ctid::text, '\((\d+),\d+\)', '\1') as page
>   from post where id in (select id from post group by id having count(*) >
> 1)
> ) select * from affected_pages, heap_page_items(get_raw_page('post',
> page::integer));
>  page  | lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_field3 |
> t_ctid   | t_infomask2 | t_infomask | t_hoff | t_bits | t_oid
> -------+----+--------+----------+--------+--------+--------+----------+------------+-------------+------------+--------+--------+-------
>  28192 |  1 |   8072 |        1 |    118 |  18099 |      0 |        0 |
> (28192,1)  |          12 |       2306 |     24 |        |
>  28192 |  2 |   7952 |        1 |    118 |  18099 |  80873 |       13 |
> (28192,2)  |          12 |       6466 |     24 |        |
>  28192 |  3 |   7832 |        1 |    118 |  18099 |  80873 |       12 |
> (28192,3)  |          12 |       6466 |     24 |        |
>  28192 |  4 |      0 |        3 |      0 |        |        |

To me this pretty clearly indicates the multixact vacuuming bug from
9.3.2. But given your pg_controldata output:
Latest checkpoint's NextXID:          0/1579944
Latest checkpoint's NextMultiXactId:  592631
Latest checkpoint's NextMultiOffset:  1236955
with of ~600k multis used so far, I cannot see how it could have been
triggered without either nondefault vacuum settings or a vacuum freeze.

Do you perhaps automatedly run VACUUM with different settings from
crontab or similar? Or have per-table vacuum settings?

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
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 (16+ messages)  latest in thread

Message-ID: <20131210011042.GF27840@awork2.anarazel.de>
Permalink:  ../20131210011042.GF27840@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20131210011042.GF27840@awork2.anarazel.de

 · 

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: andres@2ndquadrant.com, maciek@heroku.com, alvherre@2ndquadrant.com
  Subject: Re: BUG #8656: Duplicate data violating unique constraints
  In-Reply-To: <20131210011042.GF27840@awork2.anarazel.de>
  References: <E1VoIgB-0005Ok-3X@wrigleys.postgresql.org> <20131205013307.GC8935@awork2.anarazel.de> <CAKwe89A0HjOZRpZuqj70zF1QvmOxTcALNEL=a6AQdQTe+dzGKQ@mail.gmail.com> <20131205091529.GD28793@alap2.anarazel.de> <CAKwe89DbQDkP9iFGesGhHH1qWiWogca2PE36DT_Ya10Cn6f1Eg@mail.gmail.com> <20131206100751.GJ7814@awork2.anarazel.de> <CAKwe89BX1KKxjjUMDRdf2ybC_7mFLBTsVKZDjO+nAUp170rmsg@mail.gmail.com> <20131210011042.GF27840@awork2.anarazel.de>

* 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