[Bucardo-general] Detect ALTER TABLE
Greg Sabino Mullane
greg at endpoint.com
Wed Jan 7 15:38:46 UTC 2009
> Just ran into a situation where I added some columns to a table without
> restarting bucardo and realized a few days later that the changes
> weren't picked up so none of the data was replicated.
> I did add the columns manually on the slave at the same time as I did on
> the master (pushdelta sync) but didn't realize I would have to restart
> bucardo to get the new columns replicated.
> Is there a way we can change bucardo to handle this situation better? I
> know the main issue was human error, but loss of data is bad regardless.
There is no easy way to handle this situation better. There are two
problems here. First, Postgres has no way to add triggers to the system
tables, so there is no way to automatically let Bucardo (or Slony) know
when a table has been altered. The second problem is that Bucardo caches
all the information about the tables on startup, thus you need to
restart Bucardo (or at least that sync) when anything about a table has
changed. We should probably make the docs clearer in that respect.
In theory, we could check the table structure before every sync, but
that would be very expensive for a relatively rare event. Perhaps that
could be a future flag, it might be worth the cost for syncs that don't
run very often.
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 226 bytes
Desc: OpenPGP digital signature
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20090107/808c09d4/attachment.bin
More information about the Bucardo-general