From: Steve Singer Date: Sun, 13 Aug 2017 02:48:38 +0000 (-0400) Subject: Fix issue where DDL issued against a non-origin node X-Git-Url: http://git.postgresql.org/gitweb/static/js/pgconfig.js?a=commitdiff_plain;h=5a53c275e15d87f0a84bcc11af95df4dc02cf7d1;p=slony1-engine.git Fix issue where DDL issued against a non-origin node can be duplicated. The code intended to only use the provider that the event was received from when querying sl_log_script but not sets however the old queries in the provider structure from previous syncs were not blanked and those queries were being issued against the other providers. Blank the provider query for providers we won't be using and ignore those providers. --- diff --git a/src/slon/remote_worker.c b/src/slon/remote_worker.c index f1c360be..52eb1f1a 100644 --- a/src/slon/remote_worker.c +++ b/src/slon/remote_worker.c @@ -3834,6 +3834,9 @@ sync_event(SlonNode * node, SlonConn * local_conn, int need_union; int sl_log_no; + + provider_query = &(provider->helper_query); + dstring_reset(provider_query); /** * ONLY use the event_provider. * If this provider has a set then that should be the @@ -3854,8 +3857,7 @@ sync_event(SlonNode * node, SlonConn * local_conn, node->no_id, provider->no_id); need_union = 0; - provider_query = &(provider->helper_query); - dstring_reset(provider_query); + (void) slon_mkquery(provider_query, "COPY ( "); @@ -4336,7 +4338,10 @@ sync_event(SlonNode * node, SlonConn * local_conn, * instead of starting the helpers we want to * perform the COPY on each provider. */ - num_errors += sync_helper((void *) provider, local_dbconn); + if(strcmp("",dstring_data(&provider->helper_query))!=0) + { + num_errors += sync_helper((void *) provider, local_dbconn); + } }