Steve Singer ssinger at ca.afilias.info
Mon May 2 06:20:20 PDT 2011
On 11-04-29 05:50 PM, Christopher Browne wrote:

<snip>

>
> What remains...
>
> slonik needs to:
> a) Lock the tables
> b) Run ddlscript_prepare(), which just does some validation, and sets
> replication mode to 'local'
> c) Split the DDL into statements
> d) Prepare a statement to drop DDL into sl_log_*
> e) For each statement
>    e.1) Run the DDL on the origin
>    e.2) Save DDL into sl_log_*
> f) Restore replication mode (probably to 'origin')
>
> slon, today, does a great deal of work, but it basically all gets dropped.
> - The DDL event doesn't need to do anything.
> - No need to split statements up.
>
> Basically, when processing sl_log_*, we'll sometimes have DDL
> statements, so that today's (Insert,Update,Delete,Truncate) augments
> to (Insert,Update,Delete,Truncate,Script), and we basically just need
> to enclose the Script items with set/restore replication mode.
>
> Still apparent complications:
> - ONLY ON NODE functionality basically just connects to the specified
> node, and omits saving the DDL in sl_log_*, right?  That's a small
> change to slonik, and requires *nothing* of slon, right?
>
> - Log shipping...  Nothing special; we're capturing sl_log_* output;
> DDL is just an addition to this.
>
> This *looks* like it turns into a considerable code simplification,
> which would be mighty nice, if so.

The algorithm you describe above sounds sane to me.  Will having slonik 
instead of slon split the ddl script up make it any less forgiving to 
bugs in the scanner (I don't think so).  I'm not sure the above changes 
will significantly simplify or reduce the code footprint.  (We still 
need the scanner just in a different place, ddlScript prepare/finish are 
fairly short, and remote_worker.c will still need a switch for 
'scripts', just under the SYNC block per row processing instead of as an 
event type).

As you stated above we still need to add in code to lock a user provided 
list of tables.


> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general



More information about the Slony1-general mailing list