/[slony-test]/adsl/test_difference.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /adsl/test_difference.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (hide annotations)
Sun Feb 11 22:27:18 2007 UTC (15 years, 3 months ago) by dpavlin
File MIME type: application/x-sh
File size: 787 byte(s)
added sync and exponential timeout for sleep

1 dpavlin 1
2     #echo "** sync"
3     #slonik_execute_script -c 'select now();' 1 | slonik
4    
5 dpavlin 3 op='=='
6     echo $0 $1 | grep 'diff' >/dev/null && op='!='
7 dpavlin 1
8 dpavlin 3 echo "name [$0 $1] op [$op]"
9 dpavlin 1
10     psql="sudo -u postgres psql adsl"
11     master="`$psql -p 5001 -c 'select * from po_mjesecima'`"
12     echo -e "## MASTER\n$master"
13     slave=''
14     oldslave=''
15 dpavlin 4 sleep=1
16 dpavlin 3 while [ ! "$master" $op "$slave" -o "$slave" == '' ] ; do
17 dpavlin 1 slave="`$psql -p 5002 -c 'select * from po_mjesecima'`"
18     if [ "$oldslave" != "$slave" ]
19     then
20     echo -e "$op SLAVE\n$slave"
21     else
22 dpavlin 4 #slonik_execute_script -c 'select now();' 1 | slonik
23     ( slonik_print_preamble ; echo 'sync(id=1);' ) | slonik
24     ( slonik_print_preamble ; echo 'sync(id=2);' ) | slonik
25 dpavlin 1 echo -n "."
26 dpavlin 4 sleep $sleep
27     sleep=`expr $sleep \* 2`
28 dpavlin 1 fi
29     oldslave="$slave"
30     done
31    
32     echo "** OK -- master $op slave **"

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26