Re: Exposing the Xact commit order to the user

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Exposing the Xact commit order to the user
Date: 2010-05-26 16:10:18
Message-ID: 4BFD47EA.7090307@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/26/2010 10:04 AM, Greg Stark wrote:
> Instead of discussing implementation I think you should start with the
> API the replication system needs.

... but to answer that request, actually I don't even think we should be
discussing API specifics.

During PGCon, Marco Kreen, Jim Nasby and I were discussing what the
requirements of a unified message queue, shared by Londiste and Slony
may look like. For some use cases of pgq, there isn't even any interest
in user table changes. These are simply a reliable, database backed
message passing system.

Today both systems use an "agreeable" order of changes selected by
rather expensive queries based on serializable snapshot information and
a global, non cacheable serial number.

This could be replaced with a logic based on the actual commit order of
the transactions. This order does not need to be 100% accurate. As long
as the order is recorded after all user actions have been performed
(trigger queue shut down) and while the transaction is still holding
onto its locks, that order is good enough. This will not allow a
conflicting transaction, waiting on locks to be released, to appear
having committed before the lock conflict winner.

It is obvious that in cases where only small portions or even none of
the user table changes are needed, holding on to or even parsing the
ENTIRE WAL sounds suboptimal for this use case.

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 Tom Lane 2010-05-26 16:21:53 Re: libpq should not be using SSL_CTX_set_client_cert_cb
Previous Message Robert Haas 2010-05-26 16:03:42 Re: Exposing the Xact commit order to the user