Christopher Browne cbbrowne
Wed Jan 25 15:14:15 PST 2006
Further to our discussion, I see a further complication for bug #1513,
immediately...

slonik submits DDL changes directly to the local node.  (see ddlscript())

As a result, the proposed state machine that splits DDL into statements
needs to be attached to both slon *and slonik*.

In effect, slonik would operate something like...

slon_mkquery (&query, "setup_ddl();");
while (s = get_next_statement(&script)) {     /* Invoke each statement
on the local node */
  slon_appendquery(&query, "invoke_ddl_int('%s');", s);
}
slon_appendquery(&query, "finish_ddl(%s);", &script);  /* Submit the
whole script to propagate to other nodes */

Which would parallel, in slon, something like...

            else if (strcmp(event->ev_type, "DDL_SCRIPT") == 0)
            {
                int            ddl_setid = (int)strtol(event->ev_data1,
NULL, 10);
                char       *ddl_script = event->ev_data2;
                int            ddl_only_on_node =
(int)strtol(event->ev_data3, NULL, 10);

                slon_appendquery(&query, "setup_ddl_int();");
                while (s = get_next_statement(&script)) {     /* Invoke
each statement on the local node */
                      slon_appendquery(&query, "invoke_ddl_int('%s');", s);
                }
                slon_appendquery(&query, "finish_ddl_int();");

I am, of course, covering over all the complications of
get_next_statement() :-).



More information about the Slony1-general mailing list