bakwc/PySyncObj

logcompaction only dumps on one machine when logCompactionSplit=True

Closed this issue · 0 comments

Under Python3.6, I noticed that in a 3-server cluster, logcompaction only dumps on one machine. Looking into the code, I suspect this line might be buggy:
periodStart = int(currTime) / interval * interval
and should be replaced with
periodStart = int(currTime / interval) * interval
This is not an issue with python 2.7. But in Python 3, division of two integers gives a float and thus periodStart=currTime. This causes the test
if currTime < nodeIntervalStart or currTime >= nodeIntervalEnd:
always fail only on one particular machine if their time is near identical(say within 1 second).