Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2D5AB64FFC4 for ; Sat, 6 Sep 2008 22:37:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01627-07 for ; Sat, 6 Sep 2008 22:37:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id E353A64FFAA for ; Sat, 6 Sep 2008 22:37:24 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id m871V2j00862; Sat, 6 Sep 2008 21:31:02 -0400 (EDT) From: Bruce Momjian Message-Id: <200809070131.m871V2j00862@momjian.us> Subject: Re: Incorrect description of xmax and xip in functions docs In-Reply-To: <1220628702.4371.1214.camel@ebony.2ndQuadrant> To: Simon Riggs Date: Sat, 6 Sep 2008 21:31:02 -0400 (EDT) CC: pgsql-docs X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1220751062-4048-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/4 X-Sequence-Number: 4965 --ELM1220751062-4048-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Simon Riggs wrote: > > On Fri, 2008-09-05 at 16:14 +0100, Simon Riggs wrote: > > http://developer.postgresql.org/pgdocs/postgres/functions-info.html > > > > xip_list is described as > > > > "Active txids at the time of the snapshot... " > > > > > > This is incorrect. The xip_list is the list of transactions that are in > > progress *and* less than xmax. There may be transactions in progress > > with an xid higher than xmax. This will happen frequently in fact. This > > is because xmax is defined as the highest/latest completed xid, not the > > highest running xid. > > > > Note that there is no way to discover the list of running xids at the > > time of the snapshot, from the data we hold about snapshots. Nor can the > > snapshot data be used to monitor the number of transactions in progress. > > > > Anyone disagree? If not, I'll patch. > > My rewording would be: > "Active txids at the time of the snapshot. The list includes only those > active txids between xmin and xmax; there may be active txids higher > than xmax. A txid that is xmin <= txid < xmax and not in this list was > already completed at the time of the snapshot, and thus either visible > or dead according to its commit status. The list does not include txids > of subtransactions." Applied, and attached. > And for txid_visible_in_snapshot() comment added: > "Function should not be used with subtransaction xids. It is possible > that this function will return a true result for a subtransaction xid > that was actually still in progress at the time of the snapshot". I think the cleaner solution is to throw an appropriate error if a subtransaction xid is used, rather than adding documentation. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1220751062-4048-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.444 diff -c -c -r1.444 func.sgml *** doc/src/sgml/func.sgml 6 Sep 2008 00:01:21 -0000 1.444 --- doc/src/sgml/func.sgml 7 Sep 2008 01:27:44 -0000 *************** *** 12006,12016 **** xip_list ! Active txids at the time of the snapshot. All of them are between ! xmin and xmax. A txid that is ! xmin <= txid < xmax and not in this list was ! already completed at the time of the snapshot, and thus either visible ! or dead according to its commit status. --- 12006,12019 ---- xip_list ! Active txids at the time of the snapshot. The list ! includes only those active txids between xmin ! and xmax; there might be active txids higher ! than xmax. A txid that is xmin <= txid < ! xmax and not in this list was already completed ! at the time of the snapshot, and thus either visible or ! dead according to its commit status. The list does not ! include txids of subtransactions. --ELM1220751062-4048-0_--