You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That logic around that log message is a bit odd and probably doesn't do the right thing in all cases. @jujing, do you want to contribute a small patch or pull request for this? I think anything that avoids the underflow would be an improvement.
I wish to do that. But in my working environment, there are some limitations to prohibit me to commit code to github. And I only have a pad at home. I should solve the problem first.
For this issue, I think a simple way to avoid the underflow is that change the type of variables curr, prev, logEntries from uint64_t to int64_t.
In /Server/StateMachine.cc, function StateMachine::shouldTakeSnapshot, line 599 (version: 1.1.0)
uint64_t curr = 0;
if (lastIncludedIndex > stats.last_snapshot_index())
curr = lastIncludedIndex - stats.last_snapshot_index();
uint64_t prev = curr - 1;
Subtract operation overflows on operands "curr" and "1UL", whose values are unsigned constants, 0 and 1, respectively.
The text was updated successfully, but these errors were encountered: