diff options
author | Magnus Ahltorp <map@kth.se> | 2015-07-31 08:20:26 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2015-07-31 15:51:29 +0200 |
commit | 14db633f4f1318f651f2cf3791198eb21ea084b2 (patch) | |
tree | dfcdbf72269ef5ac98d8f34d2b4dff6a6e8d48fc | |
parent | 803adf14ec4116d2997feca38c4c259d5d47f71a (diff) |
Set verifiedsize after merge backup is verified
-rwxr-xr-x | tools/compileconfig.py | 1 | ||||
-rwxr-xr-x | tools/merge.py | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tools/compileconfig.py b/tools/compileconfig.py index 0e4a839..1e1fa41 100755 --- a/tools/compileconfig.py +++ b/tools/compileconfig.py @@ -128,6 +128,7 @@ def allowed_clients_mergesecondary(primarymergenode): ("/catlfish/merge/sendlog", [primarymergenode]), ("/catlfish/merge/verifyroot", [primarymergenode]), ("/catlfish/merge/verifiedsize", [primarymergenode]), + ("/catlfish/merge/setverifiedsize", [primarymergenode]), ("/catlfish/merge/missingentries", [primarymergenode]), ] diff --git a/tools/merge.py b/tools/merge.py index 34d1697..7453fa4 100755 --- a/tools/merge.py +++ b/tools/merge.py @@ -241,6 +241,23 @@ def verifyroot(node, baseurl, treesize): sys.stderr.flush() raise e +def setverifiedsize(node, baseurl, treesize): + try: + result = http_request(baseurl + "catlfish/merge/setverifiedsize", + json.dumps({"size":treesize}), key=own_key, verifynode=node, publickeydir=paths["publickeys"]) + return json.loads(result) + except urllib2.HTTPError, e: + print >>sys.stderr, "ERROR: setverifiedsize", e.read() + sys.exit(1) + except ValueError, e: + print >>sys.stderr, "==== FAILED REQUEST ====" + print >>sys.stderr, submission + print >>sys.stderr, "======= RESPONSE =======" + print >>sys.stderr, result + print >>sys.stderr, "========================" + sys.stderr.flush() + raise e + def get_missingentries(node, baseurl): try: result = http_request(baseurl + "ct/frontend/missingentries", key=own_key, verifynode=node, publickeydir=paths["publickeys"]) @@ -404,7 +421,7 @@ for secondary in secondaries: print >>sys.stderr, " expected", hexencode(root_hash) sys.exit(1) timing_point(timing, "verifyroot") - # XXX: set verifiedsize + setverifiedsize(nodename, nodeaddress, tree_size) if args.timing: print >>sys.stderr, timing["deltatimes"] sys.stderr.flush() |