Commit 2139af2c authored by Kirill Smelkov's avatar Kirill Smelkov

X treegen: Verify that tree actually saved to storage is what was requested

parent 9181c5d9
......@@ -194,7 +194,19 @@ def Trees(zstor, r):
# restructure ztree to requested topology
xbtree.Restructure(ztree, tree)
# commit tree to storage
head = commit("treegen/trees: %s" % treetxt)
# verify what was persisted to storage is indeed what we intended
zctx.zconn.cacheMinimize()
treetxt_onstor = zctx.ztreetxt(ztree)
if treetxt_onstor != treetxt:
panic("BUG: tree wrongly saved to storage:\nsaved: %s\nrequested: %s" %
(treetxt_onstor, treetxt))
# verify saved tree consistency
xbtree.zcheck(ztree)
# ok
xprint("%s" % ashex(head))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment