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
~/src/raft/raft_snapshot.go 中的 Snapshot 方法,在方法入口处对 index 进行了校验:如果 index > commitIndex 就直接返回。
所以49行的判断是否多余了呢?我理解经过校验后 index 是小于等于 commitIndex 的,那么也必然是小于 rf.getLastIndex()+1 的。
58行也是同理,此时 index <= commitIndex,我认为 if 的条件是走不进的。
~/src/raft/raft_snapshot.go 中的 Snapshot 方法,在方法入口处对 index 进行了校验:如果 index > commitIndex 就直接返回。
所以49行的判断是否多余了呢?我理解经过校验后 index 是小于等于 commitIndex 的,那么也必然是小于 rf.getLastIndex()+1 的。
58行也是同理,此时 index <= commitIndex,我认为 if 的条件是走不进的。
烦请解答,提前感谢了。