Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WsLKE-0003LP-0j for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Jun 2014 00:14:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WsLKD-0001cJ-GC for pgsql-bugs@arkaria.postgresql.org; Thu, 05 Jun 2014 00:14:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WsLKC-0001bw-T6 for pgsql-bugs@postgresql.org; Thu, 05 Jun 2014 00:14:32 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WsLK8-0001tU-TU for pgsql-bugs@postgresql.org; Thu, 05 Jun 2014 00:14:31 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 96C6C4E8006; Thu, 5 Jun 2014 02:14:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC5CCD.dip0.t-ipconnect.de [93.220.92.205]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 9A676500002; Thu, 5 Jun 2014 02:14:24 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 30E5D1004EC; Thu, 5 Jun 2014 02:14:24 +0200 (CEST) Date: Thu, 5 Jun 2014 02:14:24 +0200 From: Andres Freund To: Robert Haas Cc: Alvaro Herrera , Tom Lane , Postgres-Bugs , Sandro Santilli Subject: Re: uninterruptable loop: concurrent delete in progress within table Message-ID: <20140605001424.GA15695@awork2.anarazel.de> References: <20140530143150.GA11051@localhost> <20140531132841.GC1220@awork2.anarazel.de> <20140602164800.GA5146@eldon.alvh.no-ip.org> <20140602170820.GB24145@awork2.anarazel.de> <20140602172716.GC5146@eldon.alvh.no-ip.org> <20140602173536.GE24145@awork2.anarazel.de> <20140604231049.GM785@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -2.6 (--) 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 2014-06-04 19:27:54 -0400, Robert Haas wrote: > On Wed, Jun 4, 2014 at 7:10 PM, Andres Freund wrote: > > On 2014-06-04 19:03:15 -0400, Robert Haas wrote: > >> On Mon, Jun 2, 2014 at 1:35 PM, Andres Freund wrote: > >> > Robert: Do you remember that case? > >> > > >> > Alvaro: In the end it'd not be very harmful - if it happens > >> > TransactionIdDidCommit() will return false (there's special case code > >> > for it). > >> > >> Not specifically, but I'd be surprised if it isn't possible. > > > > Wouldn't that mean that every single visibility routine in tqual.c is > > buggy? > > > > I am not convinced there aren't further bugs in some corner cases in > > tqual.c. But even a low likelihood scenarious of > > xmax = InvalidTransactionId && (infomask & XMAX_INVALID) == 0 > > would have become visible by now given how widespread/central those > > tests are? > > What specifically do you think will break? If XMAX_INVALID may accidentally not be set even though there's no xmax, other xmax flags could be bogus as well. Afaics there's no difference in the handling between them. And then tests for LOCKED_ONLY, IS_MULTI and such would be dodgy. The only things that - afaics - are allowed to to change the actual xmax transactionid are: * freezing * heap_(update|delete|lock)_tuple And of those only freezing will unset xmax to InvalidTransactionId. But it re-sets XMAX_INVALID (and clears all other xmax flags). So I don't really see a danger. But you're right, even if there were cases where that case happens - without any other odd flags - we'd still be safe. 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