Chris Browne cbbrowne at lists.slony.info
Mon May 26 14:09:50 PDT 2008
Update of /home/cvsd/slony1/slony1-engine/src/backend
In directory main.slony.info:/tmp/cvs-serv12883/backend

Modified Files:
	slony1_funcs.c slony1_funcs.sql 
Log Message:
Remove code that generates + listens to LISTEN/NOTIFY events for
  Events + Confirms

remote_listen.c now functions solely via polling, which we already know
works fine, as we have had a polling mode for quite a while in the 2.0
code tree.

The slon _Restart LISTEN/NOTIFY has been left alone; making sure that this
is handled rightly will be left as a further exercise to be handled
independently.


Index: slony1_funcs.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** slony1_funcs.c	23 Apr 2008 20:35:43 -0000	1.66
--- slony1_funcs.c	26 May 2008 21:09:48 -0000	1.67
***************
*** 76,80 ****
  
  #define PLAN_NONE			0
- #define PLAN_NOTIFY_EVENT	(1 << 0)
  #define PLAN_INSERT_EVENT	(1 << 1)
  #define PLAN_INSERT_LOG		(1 << 2)
--- 76,79 ----
***************
*** 96,100 ****
  
  	int			have_plan;
- 	void	   *plan_notify_event;
  	void	   *plan_insert_event;
  	void	   *plan_insert_log_1;
--- 95,98 ----
***************
*** 148,152 ****
  	 */
  	cs = getClusterStatus(PG_GETARG_NAME(0),
! 						  PLAN_NOTIFY_EVENT | PLAN_INSERT_EVENT);
  
  	buf_size = 8192;
--- 146,150 ----
  	 */
  	cs = getClusterStatus(PG_GETARG_NAME(0),
! 						  PLAN_INSERT_EVENT);
  
  	buf_size = 8192;
***************
*** 158,169 ****
  	if (!TransactionIdEquals(cs->currentXid, newXid))
  	{
- 		/*
- 		 * Once per transaction notify on the sl_event relation
- 		 */
- /*@-nullpass@*/
- 		if ((rc = SPI_execp(cs->plan_notify_event, NULL, NULL, 0)) < 0)
- 			elog(ERROR, "Slony-I: SPI_execp() failed for \"NOTIFY event\"");
- 
- /*@+nullpass@*/
  		cs->currentXid = newXid;
  	}
--- 156,159 ----
***************
*** 1242,1259 ****
  
  	/*
- 	 * Prepare and save the PLAN_NOTIFY_EVENT
- 	 */
- 	if ((need_plan_mask & PLAN_NOTIFY_EVENT) != 0 &&
- 		(cs->have_plan & PLAN_NOTIFY_EVENT) == 0)
- 	{
- 		sprintf(query, "NOTIFY \"%s_Event\";", NameStr(cs->clustername));
- 		cs->plan_notify_event = SPI_saveplan(SPI_prepare(query, 0, NULL));
- 		if (cs->plan_notify_event == NULL)
- 			elog(ERROR, "Slony-I: SPI_prepare() failed");
- 
- 		cs->have_plan |= PLAN_NOTIFY_EVENT;
- 	}
- 
- 	/*
  	 * Prepare and save the PLAN_INSERT_EVENT
  	 */
--- 1232,1235 ----

Index: slony1_funcs.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.137
retrieving revision 1.138
diff -C2 -d -r1.137 -r1.138
*** slony1_funcs.sql	23 Apr 2008 20:35:43 -0000	1.137
--- slony1_funcs.sql	26 May 2008 21:09:48 -0000	1.138
***************
*** 1299,1304 ****
  			(p_failed_node, @NAMESPACE at .getLocalNodeId(''_ at CLUSTERNAME@''),
  			p_ev_seqfake, CURRENT_TIMESTAMP);
- 	notify "_ at CLUSTERNAME@_Event";
- 	notify "_ at CLUSTERNAME@_Confirm";
  	notify "_ at CLUSTERNAME@_Restart";
  
--- 1299,1302 ----
***************
*** 4493,4497 ****
  				values (p_con_origin, p_con_received, p_con_seqno,
  					p_con_timestamp);
- 		notify "_ at CLUSTERNAME@_Confirm";
  		v_max_seqno = p_con_seqno;
  	end if;
--- 4491,4494 ----



More information about the Slony1-commit mailing list