2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-19 12:05:13 +00:00

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.
This commit is contained in:
Jarrod Johnson 2019-01-28 16:20:07 -05:00
parent 1902a333ae
commit 188feec0b4

View File

@ -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,