From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Postgres-Bugs <pgsql-bugs@postgresql.org>
Cc: Sandro Santilli <strk@keybit.net>
Subject: Re: uninterruptable loop: concurrent delete in progress within table
Date: Wed, 04 Jun 2014 19:34:44 -0400
Message-ID: <16762.1401924884@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com>
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>
<CA+TgmoZoGhRvMv10wSUyirF2PFG7KH5xQvTOkOOmOO8BpyGvWg@mail.gmail.com>
<20140604231049.GM785@awork2.anarazel.de>
<CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Robert Haas <robertmhaas@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@2ndquadrant.com, alvherre@2ndquadrant.com, strk@keybit.net
Subject: Re: uninterruptable loop: concurrent delete in progress within table
In-Reply-To: <16762.1401924884@sss.pgh.pa.us>
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> <CA+TgmoZoGhRvMv10wSUyirF2PFG7KH5xQvTOkOOmOO8BpyGvWg@mail.gmail.com> <20140604231049.GM785@awork2.anarazel.de> <CA+Tgmobx+e2furvSi2+hxV3QVQWw9YtWC-awg6-UdgfaOiWZnQ@mail.gmail.com> <16762.1401924884@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox