Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B9231632C9A for ; Mon, 21 Dec 2009 11:49:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 18680-06 for ; Mon, 21 Dec 2009 15:49:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128144.authsmtp.com (outmail128144.authsmtp.com [62.13.128.144]) by mail.postgresql.org (Postfix) with ESMTP id A0F7563251A for ; Mon, 21 Dec 2009 11:49:09 -0400 (AST) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt10.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id nBLFmruS089639; Mon, 21 Dec 2009 15:48:53 GMT Received: from [192.168.0.3] (88-110-223-66.dynamic.dsl.as9105.com [88.110.223.66]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id nBLFmqEA023821; Mon, 21 Dec 2009 15:48:52 GMT Subject: Re: Small Bug in GetConflictingVirtualXIDs From: Simon Riggs To: Tom Lane Cc: Alvaro Herrera , Andres Freund , pgsql-hackers@postgresql.org In-Reply-To: <15331.1261409887@sss.pgh.pa.us> References: <200912210402.37850.andres@anarazel.de> <20091221152534.GB3913@alvh.no-ip.org> <15331.1261409887@sss.pgh.pa.us> Content-Type: text/plain Date: Mon, 21 Dec 2009 15:48:52 +0000 Message-Id: <1261410532.17644.3336.camel@ebony> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Server-Quench: 5704572f-ee48-11de-80b9-0022640b883e X-Report-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksachtFagRbaVxS HGQLW11EUVh7XWt/ bgkfZQ1DY0tOQQdo U1ZPRE1XHAJ3AVJf dGJoD1gHBgVEe3Zy ZAhlWHBfEkF9dUJ4 RUwCCDhTYW99aWFL BV1Qd1FdbQNKfB1D blAtXHsONCtlM3Bw LC8aFBMcBw5qYB9Q SwUJZXgPTg4KGHYT SgwpGjMhGUwOWyQ1 ICInMEIBFUIhE2kp WbCy X-Authentic-SMTP: 61633235383639.1015:706/Kp X-AuthFastPath: 255 X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/1865 X-Sequence-Number: 152568 On Mon, 2009-12-21 at 10:38 -0500, Tom Lane wrote: > Alvaro Herrera writes: > > Andres Freund wrote: > >> The logic behind this seems fine except in the case of dropping a database. > >> There you very well might have a open connection without an open snapshot. > > > Perhaps the simplest fix is to ensure that drop database gets a snapshot? > > I confess to not having followed the thread closely, but why is DROP > DATABASE special in this regard? Wouldn't we soon find ourselves > needing every utility command to take a snapshot? Andres has worded this a little imprecisely, causing a confusion. In cases regarding HS we need to be clear whether the interacting sessions are on the master or on the standby to understand the reasons for poor interactions. What he means is that you can be connected to the standby without an open snapshot (from the standby) at the point we replay a drop database command that had been run on the master. That case currently causes the bug, created by my recent change to GetConflictingVirtualXids(). Giving the drop database a snapshot is not the answer. I expect Andres to be able to fix this with a simple patch that would not effect the case of normal running. -- Simon Riggs www.2ndQuadrant.com