Jan Wieck wieck at lists.slony.info
Thu May 31 06:29:29 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/src/ducttape
In directory main.slony.info:/tmp/cvs-serv1075/src/ducttape

Modified Files:
	Makefile test_8_logship.in 
Log Message:
Fix archive log ship tracking. Slon now tracks the setsync status in memory
and generates a void archive with the correct old,new event seqno for all
events.

Jan


Index: test_8_logship.in
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/ducttape/test_8_logship.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test_8_logship.in	4 Jul 2005 23:45:21 -0000	1.1
--- test_8_logship.in	31 May 2007 13:29:26 -0000	1.2
***************
*** 24,31 ****
  export PATH
  TMPOUT=/tmp/output.$$
! LOGSHIPDIR=/tmp/logs.$$
  mkdir -p $LOGSHIPDIR
  DB1=slony_test1
  DB2=slony_test2
  CLUSTERNAME=T1
  PGBENCH_SCALE=1
--- 24,33 ----
  export PATH
  TMPOUT=/tmp/output.$$
! LOGSHIPDIR=./offline_logs
  mkdir -p $LOGSHIPDIR
+ rm -f $LOGSHIPDIR/*
  DB1=slony_test1
  DB2=slony_test2
+ DB3=slony_test3
  CLUSTERNAME=T1
  PGBENCH_SCALE=1
***************
*** 96,99 ****
--- 98,103 ----
  dropdb $DB2 || echo "**** ignored"
  sleep 1
+ dropdb $DB3 || echo "**** ignored"
+ sleep 1
  
  #####
***************
*** 104,107 ****
--- 108,118 ----
  createdb $DB1 || exit 1
  pgbench -i -s $PGBENCH_SCALE $DB1
+ psql $DB1 <<_EOF_
+ 	create sequence history_seq;
+ 	alter table history add column seqno int8;
+ 	alter table history alter column seqno set default nextval('history_seq');
+ 	update history set seqno = nextval('history_seq') where seqno is null;
+ 	alter table history add primary key (seqno);
+ _EOF_
  pg_dump -s $DB1 >pgbench_schema.sql
  
***************
*** 146,155 ****
  slonik <<_EOF_
  	include <$PREAMBLE_FILE>;
- 	try {
- 		table add key (node id = @origin, fully qualified name = 'public.history');
- 	}
- 	on error {
- 		exit 1;
- 	}
  
  	try {
--- 157,160 ----
***************
*** 166,170 ****
  		set add table (set id = 1, origin = @origin,
  			id = 4, fully qualified name = 'public.history',
! 			key = serial, comment = 'Table accounts');
  	}
  	on error {
--- 171,175 ----
  		set add table (set id = 1, origin = @origin,
  			id = 4, fully qualified name = 'public.history',
! 			comment = 'Table history');
  	}
  	on error {
***************
*** 235,243 ****
  fi
  
! echo "**** starting the Slony-I node daemon for $DB1"
  $TERMPROG -title "Slon node 22" -e sh -c "slon -d$DEBUG_LEVEL -s10000 -o10000 -g10 -a $LOGSHIPDIR $CLUSTERNAME dbname=$DB2; echo -n 'Enter>'; read line" &
  slon2_pid=$!
  echo "slon[$slon2_pid] on dbname=$DB2"
  
  #####
  # Check that pgbench is still running
--- 240,251 ----
  fi
  
! echo "**** starting the Slony-I node daemon for $DB2"
  $TERMPROG -title "Slon node 22" -e sh -c "slon -d$DEBUG_LEVEL -s10000 -o10000 -g10 -a $LOGSHIPDIR $CLUSTERNAME dbname=$DB2; echo -n 'Enter>'; read line" &
  slon2_pid=$!
  echo "slon[$slon2_pid] on dbname=$DB2"
  
+ echo "**** taking offline_dump.sql from $DB2 for logshipping"
+ sh ../../tools/slony1_dump.sh $DB2 T1 >offline_dump.sql
+ 
  #####
  # Check that pgbench is still running
***************
*** 282,285 ****
  kill $slon2_pid 2>/dev/null
  
! ./compare_pgbench_dumps $DB1 $DB2
  rm $PREAMBLE_FILE
--- 290,310 ----
  kill $slon2_pid 2>/dev/null
  
! sh ./compare_pgbench_dumps $DB1 $DB2
! 
! echo "**** creating database for offline node"
! if ! createdb $DB3 ; then
! 	exit 1
! fi
! 
! echo "---- loading pgbench schema into $DB3"
! psql -q $DB3 <./pgbench_schema.sql
! echo "---- loading Slony-I offline replica schema into $DB3"
! psql -q $DB3 <./offline_dump.sql
! echo "---- loading all offline log archives"
! for afile in $LOGSHIPDIR/*.sql ; do
! 	psql -q $DB3 <$afile
! done
! 
! sh ./compare_pgbench_dumps $DB1 $DB3
! 
  rm $PREAMBLE_FILE

Index: Makefile
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/ducttape/Makefile,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Makefile	2 Aug 2006 15:32:02 -0000	1.12
--- Makefile	31 May 2007 13:29:26 -0000	1.13
***************
*** 33,36 ****
--- 33,38 ----
  		fi; \
  	done;\
+ 	rm -rf dump.tmp.*
+ 	rm -rf offline_dump.sql offline_logs
  
  install: all installdirs



More information about the Slony1-commit mailing list