From: Steve Singer Date: Thu, 18 Jul 2013 18:03:08 +0000 (-0400) Subject: don't process a set if sl_setsync has the initial :1:1: snapshot id X-Git-Tag: REL_2_2_0_B5~10^2~3 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=5f5511bee84ec865dcaaed79729ff5b5e4a950f7;p=slony1-engine.git don't process a set if sl_setsync has the initial :1:1: snapshot id this snapshot id is reserved for setting up the value indicates that an even (ie the ACCEPT_SET) is still pending. Also be explicit about the origin this remote worker is querying sl_setsync for. --- diff --git a/src/slon/remote_worker.c b/src/slon/remote_worker.c index 3936b133..5411656c 100644 --- a/src/slon/remote_worker.c +++ b/src/slon/remote_worker.c @@ -3923,7 +3923,7 @@ sync_event(SlonNode * node, SlonConn * local_conn, slon_appendquery(&query, "%s%d", (pset->prev == NULL) ? "" : ",", pset->set_id); - slon_appendquery(&query, "); "); + slon_appendquery(&query, ") and SSY.ssy_origin=%d; ",node->no_id); start_monitored_event(&pm); res1 = PQexec(local_dbconn, dstring_data(&query)); @@ -3984,6 +3984,19 @@ sync_event(SlonNode * node, SlonConn * local_conn, char *ssy_action_list = PQgetvalue(res1, tupno1, 4); int64 ssy_seqno; + if (strcmp(ssy_snapshot,"1:1:")==0 && + ssy_seqno==0) + { + /** + * we don't yet have a row in setsync with real data + * this means the ACCEPT_SET has not yet come in. + * ignore this set. + */ + slon_log(SLON_WARN, "remoteWorkerThread_%d: skipping set %d ACCEPT_SET not yet received\n", + node->no_id, sub_set); + continue; + } + slon_scanint64(PQgetvalue(res1, tupno1, 1), &ssy_seqno); if (min_ssy_seqno < 0 || ssy_seqno < min_ssy_seqno) min_ssy_seqno = ssy_seqno;