On 1/15/2006 6:55 PM, Hannu Krosing wrote: > I may be barking at the wrong tree, but it seems that after one adds an > index on sl_log_1 which actually uses index on log_xid (using xxid_ops) > part of the index, bad things start to happen after xid grows to more > than 2G (or maybe just 1G). > > By bad things I mean both primary key conflicts and some rows not > copied.
This is apparently the case and the reason given by Tom seems quite plausible. The problem will get worked around in 1.2 with log switching. The plan I'm currently working on is to have slon periodically (every couple days or so) switch from sl_log_1 to sl_log_2 or the other way around, and as soon as the old log is logically empty to issue a truncate on it. This will also truncate the indexes and thereby avoid the xid wrap problem. Jan > > It may have to do with incompatibility of xxid_ops and btree indexing as > discussed in > > http://archives.postgresql.org/pgsql-hackers/2005-09/msg00195.php > > and followups. > > Quote: > "If they do actually make btree indexes on XIDs then they > are probably broken. > > XID comparison works OK as long as you make sure that all the XIDs > extant in the system at any one time are within +/- 2 billion of each > other, and so transitivity does hold within that subset. The problem > with a btree is that upper-level tree nodes are likely to contain page > boundary keys copied from data that vanished some time ago from the > underlying table." > > Does anybody have similar experiences, or am I doing something else > wrong ? > > I can see two "easy" ways around it: > > 1) always migrate db to a freshly initdb'd database before 1G > transactions > > or > > 2) move to 64bit xids and forget our current hacery around xids and > their wraparounds > > third way is to somehow keep track ow wraparounds inside slony and cast > wraparound_count*4G + xid to long int and use this as xxid. this seems > doable, but somewhat a pita. > > ------------- > Hannu > > > _______________________________________________ > Slony1-general mailing list > [email protected] > http://gborg.postgresql.org/mailman/listinfo/slony1-general -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== [EMAIL PROTECTED] # _______________________________________________ Slony1-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/slony1-general
