Home > Archive > Slony1 PostgreSQL Replication > January 2006 > module for 8-byte transaction ids









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author module for 8-byte transaction ids
Marko Kreen

2006-01-19, 7:24 am

This is how I solved the xid-wraparound problem for a project I work
on. The thought of indexing 4-byte xid's gave me nightmares.
[1]

It is based on xxid module from Slony but made keep track of wraparound.
Also I dropped the separate type for xid and made it use regular int8.
Thus no need for lots of type support functions.
The correctness check can be achieved with

create domain txid as int8 check (value > 0)

It uses relaxed method for wraparound check. There is a table
txid_wrap (epoch, last_value) which is used to check if the xid
is in current, next or previous epoch. It requires only occasional
read-write access - ca. after 100k - 500k transactions.

Ofourse it will fail if there will be mo than 2G transactions
between calls to module functions. So the proper place for
such funtionality would be the code backend, which could also
manage the storage more elegantly.

Now the question is - does the approach have any deficiencies?
Would it be useful for Slony? Would it be useful to push it
upstream in some form?

--
marko

[1] OTOH, I agree with -hackers that there is no point in 8-byte
internal xid - it would be a waste.

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com