Re: pgsql: Fix a couple of bugs in MultiXactId freezing

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix a couple of bugs in MultiXactId freezing
Date: 2013-12-05 13:42:35
Message-ID: 20131205134235.GR5158@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Andres Freund wrote:
> On 2013-12-03 19:55:40 -0300, Alvaro Herrera wrote:
> > I added a new isolation spec to test this specific case, and noticed
> > something that seems curious to me when that test is run in REPEATABLE
> > READ mode: when the UPDATE is aborted, the concurrent FOR UPDATE gets a
> > "can't serialize due to concurrent update", but when the UPDATE is
> > committed, FOR UPDATE works fine. Shouldn't it happen pretty much
> > exactly the other way around?
>
> That's 247c76a989097f1b4ab6fae898f24e75aa27fc1b . Specifically the
> DidCommit() branch in test_lockmode_for_conflict(). You forgot something
> akin to
> /* locker has finished, all good to go */
> if (!ISUPDATE_from_mxstatus(status))
> return HeapTupleMayBeUpdated;

So I did. Here are two patches, one to fix this issue, and the other to
fix the issue above. I intend to apply these two to 9.3 and master, and
then apply your freeze fix on top (which I'm cleaning up a bit -- will
resend later.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Avoid-resetting-Xmax-when-it-s-a-multi-with-an-abort.patch text/x-diff 3.3 KB
0002-Fix-improper-abort-during-update-chain-locking.patch text/x-diff 12.6 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2013-12-05 13:49:53 Re: pgsql: Fix a couple of bugs in MultiXactId freezing
Previous Message Magnus Hagander 2013-12-04 20:51:57 Re: pgsql: Fix a couple of bugs in MultiXactId freezing

Browse pgsql-hackers by date

  From Date Subject
Next Message Sameer Kumar 2013-12-05 13:43:54 Re: [HACKERS] Changes in Trigger Firing
Previous Message Sameer Kumar 2013-12-05 13:34:29 Re: Changes in Trigger Firing