David TECHER davidtecher at yahoo.fr
Mon Feb 27 06:32:25 PST 2012
Hi Steve

Thanks for your reply.

Kind regards.

David.



________________________________
 De : Steve Singer <steve at ssinger.info>
À : David TECHER <davidtecher at yahoo.fr> 
Cc : Slony Hackers <slony1-hackers at lists.slony.info> 
Envoyé le : Lundi 27 février 2012 4h16
Objet : Re: [Slony1-hackers] Updating table DDL by removing table/adding from/to replication
 
On Sun, 26 Feb 2012, David TECHER wrote:

> Hi
> 
> I use Slony 1.2.22
> 
> Replication: 1 master and 3 slaves.

> "Slony command DDL"  can not be used because it will take to much time and
> we've got a lot of replicated tables.
> I am afraid that window of week-end will be not enough.

I assume the problem is that you have a lot of tables and that the time slony takes to remove the replication triggers on each table in execute_script is to long. You should plan an upgrade to 2.x since execute script no longer does this.

> For the next update, what I would like to suggest to my team  ( and we will
> have the intention to test if I can convice them) is
> 
> 1)  removing all tables - to be altered -  from replication using set drop
> table(origin=??,id=??)
> 
> 2) apply all DDL queries to the future altered table ( usual way : psql
> ....database)
> 
> 3)  back all altered tables to replication :
>          - create set (...)
>          - set add table(...) to new set
>         - merge set (new set to the old set associated to the altered
> table).
> 
> Can we do that? 

I don't see any reason why that wouldn't work. You would need to subscribe the subscribers to the new set before you do the merge set.  This will cause the tables on the subscriber to be truncated and re-populated.  As always, you should make sure you do proper 'wait for events' so the subscribe doesn't happen before all of the subscriber has seen the drop table.

Steve


> 
> There is no concurrent activity and we've got the window of the week-end.
> 
> Thanks for your reply.
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.slony.info/pipermail/slony1-hackers/attachments/20120227/fb675f3f/attachment.htm 


More information about the Slony1-hackers mailing list