X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 8F81E9FB257 for ; Mon, 7 Aug 2006 10:09:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 58077-06 for ; Mon, 7 Aug 2006 13:09:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id EFF629FB20F for ; Mon, 7 Aug 2006 10:09:40 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k77D9bYg019739; Mon, 7 Aug 2006 09:09:37 -0400 (EDT) To: ITAGAKI Takahiro cc: pgsql-hackers@postgresql.org, Katsuhiko Okano Subject: Re: CSStorm occurred again by postgreSQL8.2 In-reply-to: <20060807114525.5266.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> References: <200607181650.EDC81237.LOBJUTPuIPPBLLV@oss.ntt.co.jp> <5126.1153241513@sss.pgh.pa.us> <20060807114525.5266.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> Comments: In-reply-to ITAGAKI Takahiro message dated "Mon, 07 Aug 2006 13:36:56 +0900" Date: Mon, 07 Aug 2006 09:09:37 -0400 Message-ID: <19738.1154956177@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/397 X-Sequence-Number: 87890 ITAGAKI Takahiro writes: > The invokers of SubTrans module are two SubTransGetTopmostTransaction() > in HeapTupleSatisfiesSnapshot(). When I disabled the calls, CSStorm did > not occur. SubTransGetTopmostTransaction returns the argument without > change when we don't use SAVEPOINTs. > If we optimize for non-subtransactions, we can avoid to lock SubTrans > for check visiblities of tuples inserted by top transactions. Only for top transactions still in progress, so I doubt that would help much. I'm wondering about doing something similar to what TransactionIdIsInProgress does, ie, make use of the PGPROC lists of live subtransactions. Suppose that GetSnapshotData copies not only top xids but live subxids into the snapshot, and adds a flag indicating whether the subxids are complete (ie, none of the subxid lists have overflowed). Then if the flag is set, tqual.c doesn't need to do SubTransGetTopmostTransaction() before searching the list. regards, tom lane