From 188feec0b4fa32f25faf1418dcfa84ff16d0fac4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 28 Jan 2019 16:20:07 -0500 Subject: [PATCH] Repair if transactioncount exists but wrong size If filesystem is full, this could be a side effect that would impact a later start in a collective context. This mechanism induces repair from a collective peer. --- confluent_server/confluent/config/configmanager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 4fcc0b71..bcddd8a8 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -2029,7 +2029,9 @@ class ConfigManager(object): rootpath = cls._cfgdir try: with open(os.path.join(rootpath, 'transactioncount'), 'r') as f: - _txcount = struct.unpack('!Q', f.read())[0] + txbytes = f.read() + if len(txbytes) == 8: + _txcount = struct.unpack('!Q', txbytes)[0] except IOError: pass _load_dict_from_dbm(['collective'], os.path.join(rootpath,