Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqBqc-0006m0-JU for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2013 01:10:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VqBqb-0007es-UL for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Dec 2013 01:10:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqBqa-0007ek-Uf for pgsql-bugs@postgresql.org; Tue, 10 Dec 2013 01:10:49 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VqBqY-0006IE-63 for pgsql-bugs@postgresql.org; Tue, 10 Dec 2013 01:10:48 +0000 Received: from anarazel.de (p5DDC4910.dip0.t-ipconnect.de [93.220.73.16]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0M31EZ-1VXHz20XLj-00s6hC; Tue, 10 Dec 2013 02:10:43 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 7FD46100BC9; Tue, 10 Dec 2013 02:10:42 +0100 (CET) Date: Tue, 10 Dec 2013 02:10:42 +0100 From: Andres Freund To: Maciek Sakrejda Cc: Alvaro Herrera , pgsql-bugs@postgresql.org Subject: Re: BUG #8656: Duplicate data violating unique constraints Message-ID: <20131210011042.GF27840@awork2.anarazel.de> References: <20131205013307.GC8935@awork2.anarazel.de> <20131205091529.GD28793@alap2.anarazel.de> <20131206100751.GJ7814@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:Z5cRvj+gpdS86PRWVp4LgUUCXkvL9nZIIQxDve79Sos lAjHiOwNTrjlpb6g55HWSol7MtUEOC0DkZA3Fqafsjcm5vs68k HQkkg5gBNxd/G5cXJtxuSiM8M4QN6gi7lgPOP4fBHJfd7cil35 MKAOjgUQwGkxzDgSreuDgc1KKDleSw6EkKFnp6IDWTSVndMLpG hXBrrRcwC21NYI/H6CbYi4M///0tqpZCejxfFp3u7Sslt3WNdg JnK7fthZ1StP8rTKGdxNh9AmOXk7eXnCPtmz6L3dIfa/AssVm9 V2bMg9Oocg/HySs5oiS9loM3dpVxy3Y4UZFpGTYKe4m5pW7EJE Xs0iN+zn1RX3stxpmSBXewjhn3EPJHoHfLj2K8tBX X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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