Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DCA2C1337A5D for ; Wed, 6 Apr 2011 23:02:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 50785-08 for ; Thu, 7 Apr 2011 02:02:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11]) by mail.postgresql.org (Postfix) with ESMTP id 2030A133655C for ; Wed, 6 Apr 2011 23:02:12 -0300 (ADT) Received: by mail.netbsd.org (Postfix, from userid 1270) id D851019CF0A; Thu, 7 Apr 2011 02:02:10 +0000 (UTC) To: drkp@csail.mit.edu Cc: pgsql-hackers@postgresql.org, Kevin.Grittner@wicourts.gov, heikki.linnakangas@enterprisedb.com Subject: Re: SSI bug? In-Reply-To: Your message of "Sun, 3 Apr 2011 02:16:44 -0400" <20110403061644.GS81592@csail.mit.edu> References: <20110403061644.GS81592@csail.mit.edu> X-Mailer: Cue version 0.8 (100217-1432/takashi) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Message-Id: <20110407020210.D851019CF0A@mail.netbsd.org> Date: Thu, 7 Apr 2011 02:02:10 +0000 (UTC) From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/359 X-Sequence-Number: 185562 hi, > 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? i'm currently running bf6848bc8c82e82f857d48185554bc3e6dcf1013 with this patch applied. i haven't seen the symptom yet. i'll keep it running for a while. btw, i've noticed the following message in the server log. is it normal? LOG: could not truncate directory "pg_serial": apparent wraparound YAMAMOTO Takashi > > Dan > > > -- > Dan R. K. Ports MIT CSAIL http://drkp.net/