summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Singer2017-08-13 02:48:38 +0000
committerSteve Singer2018-08-08 16:21:08 +0000
commit5a53c275e15d87f0a84bcc11af95df4dc02cf7d1 (patch)
tree4b205e686b1e76d664e87f353836af30f57e8849
parentf8059d0d93b7762b381b34f055fbca086c608f5a (diff)
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.
-rw-r--r--src/slon/remote_worker.c11
1 files changed, 8 insertions, 3 deletions
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);
+ }
}