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

Modified Files:
	slony1_base.sql slony1_funcs.sql 
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: slony1_base.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_base.sql,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** slony1_base.sql	11 Dec 2007 19:30:29 -0000	1.38
--- slony1_base.sql	14 Feb 2008 22:21:42 -0000	1.39
***************
*** 23,28 ****
  	no_active			bool,
  	no_comment			text,
- 	no_spool			boolean,
- 
  	CONSTRAINT "sl_node-pkey"
  		PRIMARY KEY (no_id)
--- 23,26 ----
***************
*** 32,36 ****
  comment on column @NAMESPACE at .sl_node.no_active is 'Is the node active in replication yet?';  
  comment on column @NAMESPACE at .sl_node.no_comment is 'A human-oriented description of the node';
- comment on column @NAMESPACE at .sl_node.no_spool is 'Is the node being used for log shipping?';  
  
  
--- 30,33 ----

Index: slony1_funcs.sql
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/backend/slony1_funcs.sql,v
retrieving revision 1.130
retrieving revision 1.131
diff -C2 -d -r1.130 -r1.131
*** slony1_funcs.sql	13 Feb 2008 18:40:29 -0000	1.130
--- slony1_funcs.sql	14 Feb 2008 22:21:42 -0000	1.131
***************
*** 696,700 ****
  	-- ----
  	perform setval(''@NAMESPACE at .sl_local_node_id'', p_local_node_id);
! 	perform @NAMESPACE at .storeNode_int (p_local_node_id, p_comment, false);
  
  	if (pg_catalog.current_setting(''max_identifier_length'')::integer - pg_catalog.length(''@NAMESPACE@'')) < 5 then
--- 696,700 ----
  	-- ----
  	perform setval(''@NAMESPACE at .sl_local_node_id'', p_local_node_id);
! 	perform @NAMESPACE at .storeNode_int (p_local_node_id, p_comment);
  
  	if (pg_catalog.current_setting(''max_identifier_length'')::integer - pg_catalog.length(''@NAMESPACE@'')) < 5 then
***************
*** 715,723 ****
  
  -- ----------------------------------------------------------------------
! -- FUNCTION storeNode (no_id, no_comment, no_spool)
  --
  --	Generate the STORE_NODE event.
  -- ----------------------------------------------------------------------
! create or replace function @NAMESPACE at .storeNode (int4, text, boolean)
  returns bigint
  as '
--- 715,723 ----
  
  -- ----------------------------------------------------------------------
! -- FUNCTION storeNode (no_id, no_comment)
  --
  --	Generate the STORE_NODE event.
  -- ----------------------------------------------------------------------
! create or replace function @NAMESPACE at .storeNode (int4, text)
  returns bigint
  as '
***************
*** 725,757 ****
  	p_no_id			alias for $1;
  	p_no_comment	alias for $2;
- 	p_no_spool		alias for $3;
- 	v_no_spool_txt	text;
  begin
! 	if p_no_spool then
! 		v_no_spool_txt = ''t'';
! 	else
! 		v_no_spool_txt = ''f'';
! 	end if;
! 	perform @NAMESPACE at .storeNode_int (p_no_id, p_no_comment, p_no_spool);
  	return  @NAMESPACE at .createEvent(''_ at CLUSTERNAME@'', ''STORE_NODE'',
! 									p_no_id::text, p_no_comment::text, 
! 									v_no_spool_txt::text);
  end;
  ' language plpgsql
  	called on null input;
  
! comment on function @NAMESPACE at .storeNode(int4, text, boolean) is
  'no_id - Node ID #
  no_comment - Human-oriented comment
- no_spool - Flag for virtual spool nodes
  
  Generate the STORE_NODE event for node no_id';
  
  -- ----------------------------------------------------------------------
! -- FUNCTION storeNode_int (no_id, no_comment, no_spool)
  --
  --	Process the STORE_NODE event.
  -- ----------------------------------------------------------------------
! create or replace function @NAMESPACE at .storeNode_int (int4, text, boolean)
  returns int4
  as '
--- 725,748 ----
  	p_no_id			alias for $1;
  	p_no_comment	alias for $2;
  begin
! 	perform @NAMESPACE at .storeNode_int (p_no_id, p_no_comment);
  	return  @NAMESPACE at .createEvent(''_ at CLUSTERNAME@'', ''STORE_NODE'',
! 									p_no_id::text, p_no_comment::text);
  end;
  ' language plpgsql
  	called on null input;
  
! comment on function @NAMESPACE at .storeNode(int4, text) is
  'no_id - Node ID #
  no_comment - Human-oriented comment
  
  Generate the STORE_NODE event for node no_id';
  
  -- ----------------------------------------------------------------------
! -- FUNCTION storeNode_int (no_id, no_comment)
  --
  --	Process the STORE_NODE event.
  -- ----------------------------------------------------------------------
! create or replace function @NAMESPACE at .storeNode_int (int4, text)
  returns int4
  as '
***************
*** 759,763 ****
  	p_no_id			alias for $1;
  	p_no_comment	alias for $2;
- 	p_no_spool		alias for $3;
  	v_old_row		record;
  begin
--- 750,753 ----
***************
*** 779,784 ****
  		-- ----
  		update @NAMESPACE at .sl_node
! 				set no_comment = p_no_comment,
! 				no_spool = p_no_spool
  				where no_id = p_no_id;
  	else
--- 769,773 ----
  		-- ----
  		update @NAMESPACE at .sl_node
! 				set no_comment = p_no_comment
  				where no_id = p_no_id;
  	else
***************
*** 787,792 ****
  		-- ----
  		insert into @NAMESPACE at .sl_node
! 				(no_id, no_active, no_comment, no_spool) values
! 				(p_no_id, ''f'', p_no_comment, p_no_spool);
  	end if;
  
--- 776,781 ----
  		-- ----
  		insert into @NAMESPACE at .sl_node
! 				(no_id, no_active, no_comment) values
! 				(p_no_id, ''f'', p_no_comment);
  	end if;
  
***************
*** 795,802 ****
  ' language plpgsql;
  
! comment on function @NAMESPACE at .storeNode_int(int4, text, boolean) is
  'no_id - Node ID #
  no_comment - Human-oriented comment
- no_spool - Flag for virtual spool nodes
  
  Internal function to process the STORE_NODE event for node no_id';
--- 784,790 ----
  ' language plpgsql;
  
! comment on function @NAMESPACE at .storeNode_int(int4, text) is
  'no_id - Node ID #
  no_comment - Human-oriented comment
  
  Internal function to process the STORE_NODE event for node no_id';
***************
*** 1504,1509 ****
  begin
  	insert into @NAMESPACE at .sl_node
! 		(no_id, no_active, no_comment, no_spool)
! 		select p_no_id, no_active, p_no_comment, no_spool
  		from @NAMESPACE at .sl_node
  		where no_id = p_no_provider;
--- 1492,1497 ----
  begin
  	insert into @NAMESPACE at .sl_node
! 		(no_id, no_active, no_comment)
! 		select p_no_id, no_active, p_no_comment
  		from @NAMESPACE at .sl_node
  		where no_id = p_no_provider;
***************
*** 5305,5309 ****
  	          where (ev_origin, ev_seqno) in (select ev_origin, min(ev_seqno) from @NAMESPACE at .sl_event where ev_type = ''SYNC'' group by ev_origin)
  		loop
! 			if exists select 1 from @NAMESPACE at .sl_log_1 where log_origin = v_origin and log_txid < v_xmin limit 1 then
  				v_purgeable := ''false'';
  			end if;
--- 5293,5297 ----
  	          where (ev_origin, ev_seqno) in (select ev_origin, min(ev_seqno) from @NAMESPACE at .sl_event where ev_type = ''SYNC'' group by ev_origin)
  		loop
! 			if (exists (select 1 from @NAMESPACE at .sl_log_1 where log_origin = v_origin and log_txid < v_xmin limit 1)) then
  				v_purgeable := ''false'';
  			end if;
***************
*** 5495,5498 ****
--- 5483,5491 ----
  
  		-- ----
+ 		-- Drop no_spool from sl_node
+ 		-- ----
+ 		execute ''alter table @NAMESPACE at .sl_node drop column no_spool;'';
+ 
+ 		-- ----
  		-- create new type - vactables - used by TablesToVacuum()
  		-- ----



More information about the Slony1-commit mailing list