Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 87D03D84656 for ; Fri, 8 Jun 2012 08:41:03 -0300 (ADT) Received: from moutng.kundenserver.de ([212.227.126.171]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ScxYq-0001At-3C for pgsql-bugs@postgresql.org; Fri, 08 Jun 2012 11:41:02 +0000 Received: from awork2.localnet (p5DDC789C.dip.t-dialin.net [93.220.120.156]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MARW2-1SoU8T1ZVa-00BmPd; Fri, 08 Jun 2012 13:40:47 +0200 From: Andres Freund Organization: 2ndquadrant.com To: pgsql-bugs@postgresql.org Subject: Re: BUG #6661: out-of-order XID insertion in KnownAssignedXids Date: Fri, 8 Jun 2012 13:40:45 +0200 User-Agent: KMail/1.13.7 (Linux/3.4.0-andres; KDE/4.7.4; x86_64; ; ) Cc: Valentine Gogichashvili , Simon Riggs References: <201206081242.00890.andres@2ndquadrant.com> In-Reply-To: <201206081242.00890.andres@2ndquadrant.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201206081340.45246.andres@2ndquadrant.com> X-Provags-ID: V02:K0:tUy7rI9KmYfOktKmZJXexw2SnQSLARbpDWVx7NaV0// cybN2Qlz7PhuFcS/jty/aW/qays06eMbFir8toaVOnvfrcfEjh +aHNnqyim6+oq0EO0wvtNwUylPQ0OAQ8W1dPhKNdWHYA/vu3BY d1dHP4qv9cN05M21Y2OqjV4ijewnSLmhuyHZ+1qNK1LtjABrDK Cs+DkGqBG9tBnVOInKvILa4igzWQbdTGqAOodKJpWHCyXfztcM 4XLgtAtaZIzkJ6fDSfzYKwS9mCIODarl7cHNMtG9jy5r8Q4kus AaOxrtabMEEL8k+dY505SSCWRzK5Szb039r8GoWByiVxoHmVc1 72zxYKYvVhAYCog2mGUtI9RPoCEgQV8sYksuhNxbB X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/60 X-Sequence-Number: 33287 Hi All, On Friday, June 08, 2012 12:42:00 PM Andres Freund wrote: > On Friday, June 08, 2012 12:25:25 PM Valentine Gogichashvili wrote: > > unfortunately I did not manage to keep the snapshot of the database, that > > had this issue. Ok, after some playing I could reproduce the issue: master: S1: CREATE FUNCTION insertone() RETURNS void LANGUAGE plpgsql AS $$BEGIN INSERT INTO data(data) VALUES (random()); EXCEPTION WHEN division_by_zero THEN RAISE NOTICE 'huh'; END;$$; S1: BEGIN; S1: SELECT insertone() FROM generate_series(1, 1000); --subxid overflow S2: BEGIN; S2: SELECT insertone(); --allocate xid standby: pg_basebackup LOG: 00000: consistent recovery state reached at 0/5C0001C0 LOG: 00000: recovery snapshot waiting for non-overflowed snapshot or until oldest active xid on standby is at least 4752 (now 3750) master: S1: commit: S3: checkpoint; standby: before patch: crash in assert/elog after: LOG: 00000: recovery snapshots are now enabled So I can confirm the above patch fixes at least that bug. Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services