Closed shimingyah closed 2 months ago
Notice the following code:
for _, v := range cs { if v.index > s.index { panic("v.index > s.index is unexpected") } // re-write the index for extra safety. // we don't know what we don't know. v.index = s.index }
Implementation of etcd, no need to re-write index. https://github.com/etcd-io/raft/blob/main/read_only.go#L81
Is there some kind of BUG? Can we not re-write index?
index of the log is never rewritten.
as explained by the comments, code above is for extra protections. I don't think there is any bug here.
Notice the following code:
Implementation of etcd, no need to re-write index. https://github.com/etcd-io/raft/blob/main/read_only.go#L81
Is there some kind of BUG? Can we not re-write index?