On Mon, May 12, 2014 at 2:56 PM, Heikki Linnakangas <hlinnakan...@vmware.com> wrote: > Currently, before consulting the clog for an XID's status, it is necessary > to first check if the transaction is still in progress by scanning the proc > array. To get rid of that requirement, just before writing the commit record > in the WAL, the backend will mark the clog slot with a magic value that says > "I'm just about to commit". After writing the commit record, it is replaced > with the record's actual LSN. If a backend sees the magic value in the clog, > it will wait for the transaction to finish the insertion, and then check > again to get the real LSN. I'm thinking of just using XactLockTableWait() > for that. This mechanism makes the insertion of a commit WAL record and > updating the clog appear atomic to the rest of the system.
Would it be useful to store the current WAL insertion point along with the "about to commit" flag so it's effectively a promise that this transaction will commit no earlier than XXX. That should allow most transactions to decide if those records are visible or not unless they're very recent transactions which started in that short window while the committing transaction was in the process of committing. -- greg -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers