Re: SSI bug? - Mailing list pgsql-hackers

From Dan Ports
Subject Re: SSI bug?
Date
Msg-id 20110403061644.GS81592@csail.mit.edu
Whole thread Raw
In response to Re: SSI bug?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: SSI bug?  (yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi))
Re: SSI bug?  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
I think I see what is going on now. We are sometimes failing to set the
commitSeqNo correctly on the lock. In particular, if a lock assigned to
OldCommittedSxact is marked with InvalidSerCommitNo, it will never be
cleared.

The attached patch corrects this:
 TransferPredicateLocksToNewTarget should initialize a new lock
 entry's commitSeqNo to that of the old one being transferred, or take
 the minimum commitSeqNo if it is merging two lock entries.

 Also, CreatePredicateLock should initialize commitSeqNo for to
 InvalidSerCommitSeqNo instead of to 0. (I don't think using 0 would
 actually affect anything, but we should be consistent.)

 I also added a couple of assertions I used to track this down: a
 lock's commitSeqNo should never be zero, and it should be
 InvalidSerCommitSeqNo if and only if the lock is not held by
 OldCommittedSxact.

Takashi, does this patch fix your problem with leaked SIReadLocks?

Dan


--
Dan R. K. Ports              MIT CSAIL                http://drkp.net/

Attachment

pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Support comments on FOREIGN DATA WRAPPER and SERVER objects.
Next
From: Dave Page
Date:
Subject: FDW state from plan time