New hooks for snapshot and transaction ID acquisition from external source

Started by Michael Paquieralmost 13 years ago2 messages
#1Michael Paquier
michael.paquier@gmail.com

Hi,

What do you think about adding hooks for transaction ID and snapshot
acquisition? Those hooks could be located in AssignTransactionId:xact.c for
transaction ID and GetTransactionSnapshot:snapmgr.c for snapshots.
This is useful for multi-master applications that use external tools to
feed with unique transaction IDs and global snapshots all the nodes of a
cluster in order to maintain global data consistency and visibility, one of
the examples being cluster applications like Postgres-XC.

Opinions?
--
Michael

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#1)
Re: New hooks for snapshot and transaction ID acquisition from external source

Michael Paquier <michael.paquier@gmail.com> writes:

What do you think about adding hooks for transaction ID and snapshot
acquisition?

Not much. Those places are not only hot spots but remarkably delicate.
It's hard to see much that a plugin could do there that wouldn't be
pretty deleterious to both performance and reliability. As an example,
throwing an error in either place is dangerous, and taking any locks
they don't already take even more so.

Now of course, if your plugin breaks your database that's maybe not my
problem, but I'm concerned that even just adding a test to see if
there's a hook to call could result in measurable slowdown.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers