Re: Exposing the Xact commit order to the user - Mailing list pgsql-hackers

From Jan Wieck
Subject Re: Exposing the Xact commit order to the user
Date
Msg-id 4BFD6BD6.7010001@Yahoo.com
Whole thread Raw
In response to Re: Exposing the Xact commit order to the user  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Exposing the Xact commit order to the user
List pgsql-hackers
On 5/26/2010 1:17 PM, Heikki Linnakangas wrote:
> Could you generate the commit-order log by simply registering a commit 
> hook (RegisterXactCallback(XACT_EVENT_COMMIT)) that writes such a log 
> somewhere in the data directory? That would work with older versions 
> too, no server changes required.
> 

That would work, as it seems that the backend keeps holding on to its 
locks until after calling the callbacks.

> It would not get called during recovery, but I believe that would be 
> sufficient for Slony. You could always batch commits that you don't know 
> when they committed as if they committed simultaneously.

Here you are mistaken. If the origin crashes but can recover not yet 
flushed to xlog-commit-order transactions, then the consumer has no idea 
about the order of those commits, which throws us back to the point 
where we require a non cacheable global sequence to replay the 
individual actions of those "now batched" transactions in an agreeable 
order.

The commit order data needs to be covered by crash recovery.


Jan

-- 
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages
Next
From: Heikki Linnakangas
Date:
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages