Re: BUG #5918: SummarizeOldestCommittedSxact assertion failure - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #5918: SummarizeOldestCommittedSxact assertion failure
Date
Msg-id 4D76116C.5050506@enterprisedb.com
Whole thread Raw
In response to BUG #5918: SummarizeOldestCommittedSxact assertion failure  ("YAMAMOTO Takashi" <yamt@mwd.biglobe.ne.jp>)
Responses Re: BUG #5918: SummarizeOldestCommittedSxact assertion failure  (Dan Ports <drkp@csail.mit.edu>)
Re: BUG #5918: SummarizeOldestCommittedSxact assertion failure  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-bugs
On 08.03.2011 02:37, YAMAMOTO Takashi wrote:
>
> The following bug has been logged online:
>
> Bug reference:      5918
> Logged by:          YAMAMOTO Takashi
> Email address:      yamt@mwd.biglobe.ne.jp
> PostgreSQL version: 9.1devel
> Operating system:   NetBSD
> Description:        SummarizeOldestCommittedSxact assertion failure
> Details:
>
> running 05d93c38a791836eeceaf8edb0ea8cb19cdf2760 with my patch
> in BUG #5915 applied, i got the following assertion failure.
> given that availableList is not empty and SxactGlobalXminCount == 0,
> i guess it was raced with ReleasePredicateLocks.

Yeah, that's what it looks like. One backend calls
RegisterSerializableTransaction() while all the serializablexact slots
are in use. So it releases SerializableXactHashLock and calls
SummarizeOldestCommittedSxact(). Before SummarizeOldestCommittedSxact()
acquires SerializableFinishedListLock, another backend calls
ReleasePredicateLocks(false), triggering cleanup of old predicate locks,
and ClearOldPredicateLocks() clears all old locks. Now when
SummarizeOldestCommittedSxact() finally gets the lock, it sees that
there are no old transactions to summarize, and trips the assertion.

I think we need to just treat an empty list as normal in
SummarizeOldestcommittedSxact(), patch attached.

Thanks for yet another excellent bug report!

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #5915: OldSerXidAdd inflates pg_serial too much
Next
From: Torsten Zühlsdorff
Date:
Subject: Re: Missing Bug-Report #5904?