Re: Race condition in HEAD, possibly due to PGPROC splitup

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Race condition in HEAD, possibly due to PGPROC splitup
Date: 2011-12-14 17:52:36
Message-ID: CA+U5nMKbFeGGLWPwuXr2RcKKgsRZBbStZ6wpqMdfhiAQiYw-=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 14, 2011 at 3:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> writes:
>> Looking at CommitTransaction(), it seems quite clear to me that we
>> call ProcArrayEndTransaction() before releasing the locks held by the
>> transaction. So its quite possible that when
>> GetRunningTransactionLocks goes through the list of currently held
>> locks, the pgxact->xid is already cleared. This seems to a old bug to
>> me and not related to PGXACT work.
>
> Hm.  So maybe the correct fix is to deem the lock already released
> if we get zero when we read the xid?  It's not clear to me what the
> requirements for GetRunningTransactionLocks actually are, but if it's
> okay for it to think a lock is released slightly ahead of when the
> rest of the system thinks so, that would work.

OK, I'll look at this.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-12-14 17:59:53 Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64
Previous Message Tom Lane 2011-12-14 17:36:01 Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64