Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WsKhv-0001jV-RU for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jun 2014 23:35:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WsKhv-0002FV-68 for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Jun 2014 23:34:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WsKhu-0002FO-GV for pgsql-bugs@postgresql.org; Wed, 04 Jun 2014 23:34:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WsKhr-0006Mr-FZ for pgsql-bugs@postgresql.org; Wed, 04 Jun 2014 23:34:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s54NYiJg016763; Wed, 4 Jun 2014 19:34:44 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Alvaro Herrera , Postgres-Bugs , Sandro Santilli Subject: Re: uninterruptable loop: concurrent delete in progress within table In-reply-to: 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> Comments: In-reply-to Robert Haas message dated "Wed, 04 Jun 2014 19:27:54 -0400" Date: Wed, 04 Jun 2014 19:34:44 -0400 Message-ID: <16762.1401924884@sss.pgh.pa.us> 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 Robert Haas writes: > What specifically do you think will break? For example, in > HeapTupleSatisfiesMVCC(), if no xmax-related hint bits are set, it > looks to me like we'll end up here: > if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple))) > { > /* it must have aborted or crashed */ > SetHintBits(tuple, buffer, HEAP_XMAX_INVALID, > InvalidTransactionId); > return true; > } > Well, TransactionIdDidCommit() will call TransactionLogFetch() which > has a special case coding to handle non-normal transaction IDs, which > for InvalidTransactionId will return TRANSACTION_STATUS_ABORTED. Now > maybe that is dead code and always has been, but that wouldn't be my > bet going into it: I bet that got there for a reason. No, the code to return that for InvalidTransactionId is just there because it has to do *something*, and returning status COMMITTED is clearly not too sane. I don't believe there was ever any expectation that xmax equal to InvalidTransactionId would not have the XMAX_INVALID hint bit set. If anyone had thought about that case, they'd probably have chosen to put in a should-not-happen error for it, because it strongly suggests you're looking at corrupted data. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs