Skip to content
Snippets Groups Projects

concurrent CTL

Merged Libor Peltan requested to merge concurrent_ctl into master
1 unresolved thread
Viewing commit 43f2cd8c
Show latest version
1 file
+ 9
3
Preferences
Compare changes
@@ -24,7 +24,7 @@ def random_ctl(server, zone_name):
"zone-thaw", "zone-xfr-freeze", "zone-xfr-thaw", "zone-read", "zone-get",
"zone-stats", "conf-init", "conf-list", "conf-read", "conf-diff",
"conf-get"])
if cmd[0:5] == "zone-":
if cmd[0:5] == "zone-" and random.choice([False, True, True]):
cmd += " " + zone_name
if random.choice([False, True]):
cmd = "-b " + cmd
@@ -58,7 +58,7 @@ def ctl_txn_generic(server, txn_start, txn_modify, txn_commit, txn_abort, abort_
random_sleep()
server.ctl(txn_commit, availability=False)
except:
attempts = 6
attempts = 9
while attempts > 0:
time.sleep(2)
attempts -= 1
@@ -70,15 +70,19 @@ def ctl_txn_generic(server, txn_start, txn_modify, txn_commit, txn_abort, abort_
def bck_purge_rest(server, zone_name):
global zone_backup_running
if random.choice([False, True]) and not True in zone_backup_running.values():
zone_name = " "
if zone_name in zone_backup_running and zone_backup_running[zone_name]:
return
if " " in zone_backup_running and zone_backup_running[" "]:
return
zone_backup_running[zone_name] = True
bckdir = "%s/backup" % server.dir
bckdir += str(int(time.time()))
bckdir = " +backupdir " + bckdir
cmd_bck = "-t 14 -b zone-backup " + zone_name + bckdir
cmd_pur = "-b -f zone-purge " + zone_name
cmd_pur = "-b -f zone-purge " + ("--" if zone_name == " " else zone_name)
cmd_res = "-b zone-restore " + zone_name + bckdir
ctl_txn_generic(server, cmd_bck, cmd_pur, cmd_res, cmd_res, False)
try:
@@ -144,7 +148,9 @@ for i in range(60):
for s in [ master, slave ]:
for z in zones:
try:
s.ctl("zone-xfr-thaw " + z.name, availability=False)
s.ctl("zone-thaw " + z.name, availability=False)
s.ctl("zone-notify " + z.name, availability=False)
except:
pass