summaryrefslogtreecommitdiff
path: root/test/tcl/repmgr108.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'test/tcl/repmgr108.tcl')
-rw-r--r--test/tcl/repmgr108.tcl49
1 files changed, 17 insertions, 32 deletions
diff --git a/test/tcl/repmgr108.tcl b/test/tcl/repmgr108.tcl
index 1eb29c92..bb7d6b87 100644
--- a/test/tcl/repmgr108.tcl
+++ b/test/tcl/repmgr108.tcl
@@ -1,6 +1,6 @@
# See the file LICENSE for redistribution information.
#
-# Copyright (c) 2009, 2012 Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2015 Oracle and/or its affiliates. All rights reserved.
#
# TEST repmgr108
# TEST Subordinate connections and processes should not trigger elections.
@@ -10,7 +10,7 @@ proc repmgr108 { } {
set tnum "108"
puts "Repmgr$tnum: Subordinate\
- connections and processes should not trigger elections."
+ connections should not trigger elections."
env_cleanup $testdir
@@ -19,12 +19,12 @@ proc repmgr108 { } {
file mkdir [set cdir $testdir/CLIENT]
make_dbconfig $mdir \
- [list [list repmgr_site 127.0.0.1 $mport db_local_site on]]
+ [list [list repmgr_site 127.0.0.1 $mport db_local_site on]]
make_dbconfig $cdir \
- [list [list repmgr_site 127.0.0.1 $cport db_local_site on] \
- [list repmgr_site 127.0.0.1 $mport db_bootstrap_helper on]]
+ [list [list repmgr_site 127.0.0.1 $cport db_local_site on] \
+ [list repmgr_site 127.0.0.1 $mport db_bootstrap_helper on]]
- puts "\tRepmgr$tnum.a: Set up a pair of sites, two processes each."
+ puts "\tRepmgr$tnum.a: Set up a pair of sites, two processes on master."
set cmds {
"home $mdir"
"output $testdir/m1output"
@@ -33,11 +33,16 @@ proc repmgr108 { } {
}
set m1 [open_site_prog [subst $cmds]]
+ #
+ # It is most common to start a subordinate process with the same start
+ # value as the main replication process, but test here that we also
+ # accept "start none", which supplies flags=0 to repmgr_start().
+ #
set cmds {
"home $mdir"
"output $testdir/m2output"
"open_env"
- "start master"
+ "start none"
}
set m2 [open_site_prog [subst $cmds]]
@@ -49,14 +54,6 @@ proc repmgr108 { } {
}
set c1 [open_site_prog [subst $cmds]]
- set cmds {
- "home $cdir"
- "output $testdir/c2output"
- "open_env"
- "start client"
- }
- set c2 [open_site_prog [subst $cmds]]
-
set cenv [berkdb_env -home $cdir]
await_startup_done $cenv
@@ -66,26 +63,14 @@ proc repmgr108 { } {
# Pause to let client notice the connection loss.
tclsleep 3
- # The client main process is still running, but it shouldn't care about
- # a connection loss to the master's subordinate process.
-
- puts "\tRepmgr$tnum.c:\
- Stop client's main process, then master's main process (pause)."
- close $c1
- tclsleep 2
- close $m1
- tclsleep 3
-
- # If the client main process were still running, it would have reacted
- # to the loss of the master by calling for an election. However, with
- # only the client subordinate process still running, he cannot call for
- # an election. So, we should see no elections ever having been
- # started.
+ # We should see no elections ever having been started when master
+ # subordinate process quits.
#
set election_count [stat_field $cenv rep_stat "Elections held"]
- puts "\tRepmgr$tnum.d: Check election count ($election_count)."
+ puts "\tRepmgr$tnum.c: Check election count ($election_count)."
error_check_good no_elections $election_count 0
$cenv close
- close $c2
+ close $c1
+ close $m1
}