Chris Browne cbbrowne at lists.slony.info
Thu Feb 14 14:21:45 PST 2008
Update of /home/cvsd/slony1/slony1-engine/src/slonik
In directory main.slony.info:/tmp/cvs-serv18563/slonik

Modified Files:
	parser.y scan.l slonik.c slonik.h 
Log Message:
Expunge "SPOOLNODE" attribute that we had thought we would need for
log shipping.  It expresses itself several ways:

 1.  sl_node.no_spool (in tables)
 2.  SPOOLNODE (in slonik grammars)
 3.  In various places, as an extra function argument


Index: slonik.h
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slonik/slonik.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** slonik.h	21 Jan 2008 18:54:11 -0000	1.33
--- slonik.h	14 Feb 2008 22:21:42 -0000	1.34
***************
*** 181,185 ****
  	int			no_id;
  	char	   *no_comment;
- 	int			no_spool;
  	int			ev_origin;
  };
--- 181,184 ----

Index: parser.y
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slonik/parser.y,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** parser.y	21 Jan 2008 18:54:11 -0000	1.30
--- parser.y	14 Feb 2008 22:21:42 -0000	1.31
***************
*** 43,47 ****
  	O_SERVER,
  	O_SET_ID,
- 	O_SPOOLNODE,
  	O_TAB_ID,
  	O_TIMEOUT,
--- 43,46 ----
***************
*** 229,233 ****
  %token	K_SERVER
  %token	K_SET
- %token	K_SPOOLNODE
  %token	K_STORE
  %token	K_SUBSCRIBE
--- 228,231 ----
***************
*** 598,602 ****
  							STMT_OPTION_INT( O_ID, -1 ),
  							STMT_OPTION_STR( O_COMMENT, NULL ),
- 							STMT_OPTION_YN( O_SPOOLNODE, 0 ),
  							STMT_OPTION_INT( O_EVENT_NODE, 1 ),
  							STMT_OPTION_END
--- 596,599 ----
***************
*** 614,619 ****
  							new->no_id			= opt[0].ival;
  							new->no_comment		= opt[1].str;
! 							new->no_spool		= opt[2].ival;
! 							new->ev_origin		= opt[3].ival;
  						}
  						else
--- 611,615 ----
  							new->no_id			= opt[0].ival;
  							new->no_comment		= opt[1].str;
! 							new->ev_origin		= opt[2].ival;
  						}
  						else
***************
*** 1670,1678 ****
  						$$ = $5;
  					}
- 					| K_SPOOLNODE '=' option_item_yn
- 					{
- 						$3->opt_code	= O_SPOOLNODE;
- 						$$ = $3;
- 					}
  					| K_SECONDS '=' option_item_id
  					{
--- 1666,1669 ----
***************
*** 1816,1820 ****
  		case O_SERVER:			return "server";
  		case O_SET_ID:			return "set id";
- 		case O_SPOOLNODE:		return "spoolnode";
  		case O_TAB_ID:			return "table id";
  		case O_TIMEOUT:			return "timeout";
--- 1807,1810 ----

Index: slonik.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slonik/slonik.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** slonik.c	13 Feb 2008 23:02:40 -0000	1.86
--- slonik.c	14 Feb 2008 22:21:42 -0000	1.87
***************
*** 326,334 ****
  					}
  
- 					if (!stmt->no_spool)
- 					{
- 						if (script_check_adminfo(hdr, stmt->no_id) < 0)
- 							errors++;
- 					}
  					if (script_check_adminfo(hdr, stmt->ev_origin) < 0)
  						errors++;
--- 326,329 ----
***************
*** 1993,2002 ****
  	int			tupno;
  
! 	if (!stmt->no_spool)
! 	{
! 		adminfo1 = get_active_adminfo((SlonikStmt *) stmt, stmt->no_id);
! 		if (adminfo1 == NULL)
! 			return -1;
! 	}
  
  	adminfo2 = get_checked_adminfo((SlonikStmt *) stmt, stmt->ev_origin);
--- 1988,1995 ----
  	int			tupno;
  
! 	adminfo1 = get_active_adminfo((SlonikStmt *) stmt, stmt->no_id);
! 	if (adminfo1 == NULL)
! 		return -1;
! 	
  
  	adminfo2 = get_checked_adminfo((SlonikStmt *) stmt, stmt->ev_origin);
***************
*** 2009,2014 ****
  	dstring_init(&query);
  
-         /* Eliminate no_spool evaluation - all nodes are "real nodes" */  /* if (!stmt->no_spool) */
- 		
  	if (db_begin_xact((SlonikStmt *) stmt, adminfo1) < 0)
  	{
--- 2002,2005 ----
***************
*** 2041,2045 ****
  	 */
  	slon_mkquery(&query,
! 		     "select no_id, no_active, no_comment, no_spool "
  		     "from \"_%s\".sl_node; ",
  		     stmt->hdr.script->clustername);
--- 2032,2036 ----
  	 */
  	slon_mkquery(&query,
! 		     "select no_id, no_active, no_comment "
  		     "from \"_%s\".sl_node; ",
  		     stmt->hdr.script->clustername);
***************
*** 2056,2064 ****
  		char	   *no_active = PQgetvalue(res, tupno, 1);
  		char	   *no_comment = PQgetvalue(res, tupno, 2);
- 		char	   *no_spool = PQgetvalue(res, tupno, 3);
  		
  		slon_mkquery(&query,
! 			     "select \"_%s\".storeNode_int(%s, '%q', '%s'); ",
! 			     stmt->hdr.script->clustername, no_id, no_comment, no_spool);
  		if (*no_active == 't')
  		{
--- 2047,2054 ----
  		char	   *no_active = PQgetvalue(res, tupno, 1);
  		char	   *no_comment = PQgetvalue(res, tupno, 2);
  		
  		slon_mkquery(&query,
! 			     "select \"_%s\".storeNode_int(%s, '%q'); ",
! 			     stmt->hdr.script->clustername, no_id, no_comment);
  		if (*no_active == 't')
  		{
***************
*** 2274,2281 ****
  	/* On the existing node, call storeNode() and enableNode() */
  	slon_mkquery(&query,
! 				 "select \"_%s\".storeNode(%d, '%q', '%s'); "
  				 "select \"_%s\".enableNode(%d); ",
  				 stmt->hdr.script->clustername, stmt->no_id, stmt->no_comment,
- 				 (stmt->no_spool != 0) ? "t" : "f",
  				 stmt->hdr.script->clustername, stmt->no_id);
  	if (db_exec_evcommand((SlonikStmt *) stmt, adminfo2, &query) < 0)
--- 2264,2270 ----
  	/* On the existing node, call storeNode() and enableNode() */
  	slon_mkquery(&query,
! 				 "select \"_%s\".storeNode(%d, '%q'); "
  				 "select \"_%s\".enableNode(%d); ",
  				 stmt->hdr.script->clustername, stmt->no_id, stmt->no_comment,
  				 stmt->hdr.script->clustername, stmt->no_id);
  	if (db_exec_evcommand((SlonikStmt *) stmt, adminfo2, &query) < 0)
***************
*** 2285,2306 ****
  	}
  
- 	/* If the new node is a spool node, produce confirm rows for it */
- 	if (stmt->no_spool)
- 	{
- 		slon_mkquery(&query,
- 					 "insert into \"_%s\".sl_confirm select "
- 					 "    ev_origin, %d, max(ev_seqno), CURRENT_TIMESTAMP "
- 					 "    from \"_%s\".sl_event group by 1, 2, 4; ",
- 					 stmt->hdr.script->clustername,
- 					 stmt->no_id,
- 					 stmt->hdr.script->clustername);
- 
- 		if (db_exec_command((SlonikStmt *) stmt, adminfo2, &query) < 0)
- 		{
- 			dstring_free(&query);
- 			return -1;
- 		}
- 	}
- 
  	dstring_free(&query);
  	return 0;
--- 2274,2277 ----

Index: scan.l
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slonik/scan.l,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** scan.l	21 Jan 2008 18:54:11 -0000	1.29
--- scan.l	14 Feb 2008 22:21:42 -0000	1.30
***************
*** 125,129 ****
  set				{ return K_SET;				}
  sleep			{ return K_SLEEP;			}
- spoolnode		{ return K_SPOOLNODE;		}
  store			{ return K_STORE;			}
  subscribe		{ return K_SUBSCRIBE;		}
--- 125,128 ----



More information about the Slony1-commit mailing list