[Info-ingres] Re: Ingres/Replicator Stress Test



Hi Everyone,

I think the second row was caused by the update collision - although
given that I'm the only one writing to the backup database, I'm still not
certain why there should have been a collision problem. I'm running
with LastWriteWins collision mode, I suspect that whats occurred is the
Replicator Server got its order wrong, and replicated an update that
didn't match the data in the destination table. So having detected the
collision it just wrote a new record and ploughed on.

I note the update procedure should return error 1227 if the update is
unsuccessful, but my Update Collision record seems to have a 1392
error code. I cant find that error in the remote update procedure or any
other for that matter.

I'd selected the LastWriteWins on the grounds that it had an automatic
resolution of collisions and it seemed like a good place to start a trial.
I'm replicating Peer-to-Peer as I wanted the replicated database to be
immediately available, and to be usable in reverse should the worst
happen so I thought it reasonable to have some collision handling - but
didn't expect any as the target database should never be being used
whilst the source is live.

The replication of a single row sequential counter field is probably not
the best idea. Its given me the most problem with deadlocks and
associated problems with database procedures.

But I've got to replicate what I have with minimal disruption to the
structures and software already deployed. Even if Roy Hann is perfectly
right when he maintains sequential keys are evil, they have a certain
inertia that is hard to budge.

The deadlocking is caused by the users updates to a base table
requiring corresponding entries in the shadow and archive tables.
However, the replication server needs to scan the shadow table and
then go back to the base table to get all the data for the row being
replicated to fill in the parameters to the update procedure its about to
execute on the remote database. Its almost inevitable that the lock
contention will deadlock at this point.

Even more fun is if the Replicator Server can't find the data in the base
table as its been altered by some other process. It then has to find the
correct entry in the Archive table.

The only hope is to analyse the data flow, determine an appropriate
hash table minpages to set and then pray. I suspect partitioned tables
may be useful in many cases here. But it seems like a lot of hassle for
a single row table!

The single row sequence counter table has a few other tricks as well.
To be replicated we need a unique key. The temptation is to create a
table with a key field and the counter. The key field is a constant.
The trouble is that the shadow table then has an index of potentially
thousands of entries - all with exactly the same key. Not useful.
Plus the deadlock contention is between user updates and the
Replicator Server is now totally unavoidable as the data is always on
the same page.

The only easy way out of this is to make the single row table a hash
with a seriously large minpages keyed on the incrementing sequence
counter.

I'm beginning to think that my simple stress test has already answered
the question on an Ingres/Replicator deployment.

Does anyone have any comments/advice? Be Nice!

Martin Bowes
--
Random Titus Quote #4:
It's always funny until someone gets hurt. And then its funnier.

.



Relevant Pages

  • Re: Best checksum for filename
    ... >to use for filenames. ... >as possible to store a million filename checksums in a database. ... >I can afford something like 1/10000 collision probability. ...
    (sci.crypt)
  • Daffodil Replicator v2.1 released with Support for MySQL database
    ... Daffodil Software, a Java database and replication technology company, ... Daffodil Replicator is Open Source data synchronization software that ... MySQL Database Replication Support: Heterogeneous Data Synchronization ...
    (comp.lang.java.announce)
  • Re: [Info-Ingres] Replicator
    ... emergency backup configuration. ... Subject: Replicator ... Journal out of one database and rollforward into the other. ...
    (comp.databases.ingres)
  • Ingres Replicator on HP-UX
    ... customer who wishes to implement a contingency plan between databases ... data will be replicated to an unprotected read-only target database at ... Replicator, it's been a few years since I have really worked with it. ... The customer's version of Ingres is Ingres II 2.0/0001. ...
    (comp.databases.ingres)
  • Re: restart replication after reload of database
    ... What happened was that we had power loss in the department. ... one of the database showed that it was inconsistent. ... So before that the database was running fine....and replicator was also ... So we detroyed the database and ran reload again. ...
    (comp.databases.ingres)