Chris Browne cbbrowne at lists.slony.info
Wed Feb 6 12:20:52 PST 2008
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv4431

Modified Files:
	remote_listen.c remote_worker.c 
Log Message:
Clean out code that used to generate "Confirm" events; the code was generally
commented out in the 1.2 branch; removing it now altogether.

Also, dropping out the "NOTIFY _%s_Confirm;" requests, as this may have been
causing extra unneccessary work.


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -C2 -d -r1.163 -r1.164
*** remote_worker.c	21 Jan 2008 18:54:11 -0000	1.163
--- remote_worker.c	6 Feb 2008 20:20:50 -0000	1.164
***************
*** 2131,2141 ****
  
  	slon_appendquery(dsp,
! 					 "notify \"_%s_Event\"; "
! 					 "notify \"_%s_Confirm\"; "
! 					 "insert into %s.sl_event "
! 					 "    (ev_origin, ev_seqno, ev_timestamp, "
! 					 "     ev_snapshot, ev_type ",
! 					 rtcfg_cluster_name, rtcfg_cluster_name,
! 					 rtcfg_namespace);
  	if (event->ev_data1 != NULL)
  		dstring_append(dsp, ", ev_data1");
--- 2131,2140 ----
  
  	slon_appendquery(dsp,
! 			 "notify \"_%s_Event\"; "
! 			 "insert into %s.sl_event "
! 			 "    (ev_origin, ev_seqno, ev_timestamp, "
! 			 "     ev_snapshot, ev_type ",
! 			 rtcfg_cluster_name,
! 			 rtcfg_namespace);
  	if (event->ev_data1 != NULL)
  		dstring_append(dsp, ", ev_data1");
***************
*** 2155,2162 ****
  		dstring_append(dsp, ", ev_data8");
  	slon_appendquery(dsp,
! 					 "    ) values ('%d', '%s', '%s', '%s', '%s'",
! 					 event->ev_origin, seqbuf, event->ev_timestamp_c,
! 					 event->ev_snapshot_c, 
! 					 event->ev_type);
  	if (event->ev_data1 != NULL)
  		slon_appendquery(dsp, ", '%q'", event->ev_data1);
--- 2154,2161 ----
  		dstring_append(dsp, ", ev_data8");
  	slon_appendquery(dsp,
! 			 "    ) values ('%d', '%s', '%s', '%s', '%s'",
! 			 event->ev_origin, seqbuf, event->ev_timestamp_c,
! 			 event->ev_snapshot_c, 
! 			 event->ev_type);
  	if (event->ev_data1 != NULL)
  		slon_appendquery(dsp, ", '%q'", event->ev_data1);
***************
*** 2176,2185 ****
  		slon_appendquery(dsp, ", '%q'", event->ev_data8);
  	slon_appendquery(dsp,
! 					 "); "
! 					 "insert into %s.sl_confirm "
! 					 "	(con_origin, con_received, con_seqno, con_timestamp) "
! 					 "   values (%d, %d, '%s', now()); ",
! 					 rtcfg_namespace,
! 					 event->ev_origin, rtcfg_nodeid, seqbuf);
  }
  
--- 2175,2184 ----
  		slon_appendquery(dsp, ", '%q'", event->ev_data8);
  	slon_appendquery(dsp,
! 			 "); "
! 			 "insert into %s.sl_confirm "
! 			 "	(con_origin, con_received, con_seqno, con_timestamp) "
! 			 "   values (%d, %d, '%s', now()); ",
! 			 rtcfg_namespace,
! 			 event->ev_origin, rtcfg_nodeid, seqbuf);
  }
  

Index: remote_listen.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_listen.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** remote_listen.c	29 Jan 2008 15:56:15 -0000	1.39
--- remote_listen.c	6 Feb 2008 20:20:50 -0000	1.40
***************
*** 84,92 ****
  	PGconn	   *dbconn = NULL;
  	PGresult   *res;
- 	/* Don't bother doing anything about CONFIRM notifications
- 	PGnotify   *notification;
- 	int			forward_confirm = true;
- 	*/
- 	char		notify_confirm[256];
  	
  	struct listat *listat_head;
--- 84,87 ----
***************
*** 112,116 ****
  
  	sprintf(conn_symname, "node_%d_listen", node->no_id);
- 	sprintf(notify_confirm, "_%s_Confirm", rtcfg_cluster_name);
  
  	/*
--- 107,110 ----
***************
*** 396,402 ****
  				continue;
  		}
- 		/* forward_confirm = false; */
- 		/* } */
- 
  		/*
  		 * Wait for notification.
--- 390,393 ----
***************
*** 408,424 ****
  			break;
  
- 		/*
- 		 * Set the forward_confirm flag if there was any Confirm notification
- 		 * sent.
- 		 */
- /* Don't bother doing anything about CONFIRM notifications 
- 		PQconsumeInput(dbconn);
- 		while ((notification = PQnotifies(dbconn)) != NULL)
- 		{
- 			if (strcmp(notification->relname, notify_confirm) == 0)
- 				forward_confirm = true;
- 			PQfreemem(notification);
- 		}
- */
  	}
  
--- 399,402 ----



More information about the Slony1-commit mailing list