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 B8E9D9FB1E0 for ; Thu, 14 Sep 2006 12:31:04 -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 06419-07 for ; Thu, 14 Sep 2006 15:30:56 +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 C99679FB1BC for ; Thu, 14 Sep 2006 12:30:55 -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 k8EFUqIs029566; Thu, 14 Sep 2006 11:30:52 -0400 (EDT) To: Gregory Stark cc: Alvaro Herrera , ITAGAKI Takahiro , Bruce Momjian , pgsql-hackers@postgresql.org Subject: Re: CSStorm occurred again by postgreSQL8.2 In-reply-to: <87psdyqy2v.fsf@enterprisedb.com> References: <20060808110913.50FA.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> <200608260346.k7Q3k2g06954@momjian.us> <20060828181312.5638.ITAGAKI.TAKAHIRO@oss.ntt.co.jp> <13251.1157299738@sss.pgh.pa.us> <22080.1158198335@sss.pgh.pa.us> <87mz92so6n.fsf@enterprisedb.com> <27509.1158237711@sss.pgh.pa.us> <28167.1158241250@sss.pgh.pa.us> <28515.1158242279@sss.pgh.pa.us> <20060914142222.GA525@alvh.no-ip.org> <29128.1158244999@sss.pgh.pa.us> <87psdyqy2v.fsf@enterprisedb.com> Comments: In-reply-to Gregory Stark message dated "Thu, 14 Sep 2006 16:15:04 +0100" Date: Thu, 14 Sep 2006 11:30:52 -0400 Message-ID: <29565.1158247852@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/1117 X-Sequence-Number: 90646 Gregory Stark writes: > Tom Lane writes: >> --- and because the entries are surely added in increasing XID order, >> such an array could be binary-searched. > If they're only added if they write to disk then isn't it possible to add them > out of order? Start a child transaction, start a child of that one and write > to disk, then exit the grandchild and write to disk in the first > child? No, because we enforce child XID > parent XID. In the case above, the child xact would be given an XID when the grandchild needs one --- see recursion in AssignSubTransactionId(). The actually slightly shaky assumption above is that children of the same parent xact must subcommit in numerical order ... but as long as we have strict nesting of subxacts I think this must be so. regards, tom lane