Re: Exposing the Xact commit order to the user

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Exposing the Xact commit order to the user
Date: 2010-05-26 18:43:34
Message-ID: 4BFD6BD6.7010001@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-05-26 18:44:05 Re: Idea for getting rid of VACUUM FREEZE on cold pages
Previous Message Josh Berkus 2010-05-26 18:35:28 Re: Idea for getting rid of VACUUM FREEZE on cold pages