Subject | Re: Database replication - problem with uncommited transactions. |
---|---|
Author | franbenz |
Post date | 2010-03-24T19:37:37Z |
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@...>
wrote:
I have MULTIPLE destination databases and my central repository sends
and receives data to and from every destination.
I can't delete audit records after sending them. I could delete them
only after every destination has received those records.
When a destination receives a range of audit records, I save the first
and last pkey of the range on a SENT_AUDIT_RANGES table, with an id of
the destination database.
If inside that range there were uncommited records(audit records get
their primary key from a generator) during the sending transaction,
those records will never be sent, since that range will be marked as
sent.
So, chronology is relevant because I should only send audit records
previous to the first uncommited audit record.
Francisco.
wrote:
>was
> >
> > I think I need to explain a little bit further my problem.
> > When the replication process starts it looks on another table which
> > the last record sent from the audit table to the destinationdatabase.
> > The process should send cronologically all records following thelast
>committed
> actually the chronology isn't or shouldn't be relevant. if a record is
> inserted and then updated 15 times, it's the last, most recent
> update which is relevant. The fact that you replicate that same recordmore
> than once in a replication cycle is also irrelevant. IN this case, youwould
> replicate the insert once, then replicate the update 15 times withexactly
> the same content. All you need to do is manage the inserts first, thenthe
> updates then the deletes. So if your source finally deletes the recordtimes,
> before a repl cycle begins, the record will be inserted, updated 15
> then deleted.commited
>
> > sent record. The problem is that sometimes when the process starts
> > there
> > are some uncommited records in the audit table between other
>can't
> if they are uncommitted, then they can't be seen so the repl engine
> act on them.audit
>
> > records. In this situation the process sends all visible records and
> > saves which record is the NEW "last sent record". Sometime after the
>
> the engine should use a 2 phase commit and finally delete the the
> record after taking appropriate action. The audit table is or shouldbe
> empty after a repl cycle.Thanks for helping Alan.
> Alan
I have MULTIPLE destination databases and my central repository sends
and receives data to and from every destination.
I can't delete audit records after sending them. I could delete them
only after every destination has received those records.
When a destination receives a range of audit records, I save the first
and last pkey of the range on a SENT_AUDIT_RANGES table, with an id of
the destination database.
If inside that range there were uncommited records(audit records get
their primary key from a generator) during the sending transaction,
those records will never be sent, since that range will be marked as
sent.
So, chronology is relevant because I should only send audit records
previous to the first uncommited audit record.
Francisco.