2225377fjs

Results 2 issues of 2225377fjs

void unstableLog::slice(uint64_t lo, uint64_t hi, EntryVec *entries) { mustCheckOutOfBounds(lo, hi); entries->assign(entries_.begin() + (lo - offset_), entries_.begin() + (hi - offset_)); } 偏移值加上括号,不然可能会crash。 +hi 之后直接就越界了,哪有机会减去offset

while self.__raftCommitIndex < self.__getCurrentLogIndex(): nextCommitIndex = self.__raftCommitIndex + 1 count = 1 for node in self.__otherNodes: if self.__raftMatchIndex[node] >= nextCommitIndex: count += 1 if count > (len(self.__otherNodes) + 1) /...