From 66d06f2e7a7a0c851a0448a40ae20d8bee1c0ab3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sat, 3 Dec 2016 00:15:46 +0100 Subject: merge_sth: Don't try to go back in time. Due to a recent change in get_nfetched(), merge_sth lacking the 'sth' file could go back to a tree size of zero. It's rejected by frontend nodes with a newer tree, but it's still a severe error to produce that piece of data. We add tools/initlog.py which creates an 'sth' file with tree size 0 and have tests invoke it after starting the erlang nodes, before starting the continous merge processes. --- tools/mergetools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/mergetools.py') diff --git a/tools/mergetools.py b/tools/mergetools.py index beb41bf..1ff3fa5 100644 --- a/tools/mergetools.py +++ b/tools/mergetools.py @@ -38,7 +38,7 @@ def get_nfetched(currentsizefile, logorderfile): try: limit = json.loads(open(currentsizefile).read()) except (IOError, ValueError): - return 0 + return -1 if limit['index'] >= 0: with open(logorderfile, 'r') as f: f.seek(limit['index']*65) -- cgit v1.1