etcd-io / raft

Raft library for maintaining a replicated state machine
Apache License 2.0
666 stars 164 forks source link

Return the `actually committed index` if it's greater than the `official committed index` for `ReadIndex` #105

Closed ahrtr closed 1 year ago

ahrtr commented 1 year ago

When etcd receives committed Entries, it does the following three things concurrently,

It's possible that it has successfully responded to the client, but fails to persist the hardstate and data to bboltDB, such as crashes right before persisting the hardstate(including committed index) and the applied data to bboltDB.

After etcd starts again,

serathius commented 1 year ago

Not yet convinced that the problem is with readIndex. I would be interested more into persistence of HardState. HardState should be also persisted to WAL, isn't it guaranteed to be written?

ahrtr commented 1 year ago

See https://github.com/etcd-io/etcd/pull/16675.

This PR is a standalone change for raft.

ahrtr commented 1 year ago

Won't continue to work on this.

https://github.com/etcd-io/etcd/issues/16666#issuecomment-1747077487