[Bucardo-general] Hot database synchronization

Lev Tannen levtannen at gmail.com
Tue Mar 17 16:04:17 UTC 2009


Hello,
Scenario:
Two Postgresql sites (A and B) with master to master to master replication
running for sometime. Site B crashed. I would like  to restore restore it
from and to synchronize it with A. I want to do this without stopping the
site A.
Could anybody point my to a posting with a detail instruction on how to do
this please.

In the case there is no  detailed instruction, bellow is my understanding on
how this should be done. Please point me where I am wrong or what I have
missed.

Thank you,
Lev

Steps.

1. On A site. Create a backup using pg_dump (pg_dumpall). Write down a
backup start time.
2. On A site. Delete all records from bucardo_delta with starting date
before the backup time.
Note this step is not necessary, but useful to prevent excessive inserts
later.
3. Recreate and repopulate the Bucardo database if it was destroyed (For
example if it resided on  site B)
4. Change "swap" to "pushdelta" and set site A as the source and site B as
the target).
5. Change the type of conflict resolution to "source win".
6. On B site. Use the backup to recreate or to replicate site B.
7. Start Bucardo. Wait until it replicate A to B. (If necessary issue a
kick).
8. Return to "swap".

I believe that will work, but I have some question.
When bucardo starts replication from A to B it can encountert 3 types of
conflicts.
1. The row that it tries to delete does not exists. This is probably not a
conflict at all.
2. The row it tries to update had a value that differs from of what is
expected. Setting the conflict resolution type to "source win" should handle
this.
3. The row it tries to insert  already exists. The correct behavior in this
case would be to ignore the conflict and do nothing or to delete and
reinsert the row. My question is how to persuate Bucardo to behave one of
this way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20090317/3658c7f1/attachment.html 


More information about the Bucardo-general mailing list