When trying to use read index with safe option, raft node will choose the committed index as the index to be read. However this may not be correct when leadership is changed. New leader's committed index may not be the cluster's actual committed index until an empty entry is committed. During this period, new leader's committed index may be small than the old leader's. If read_index request is handled, it may read an old index which contains stale values.
cc @siddontang
When trying to use read index with safe option, raft node will choose the committed index as the index to be read. However this may not be correct when leadership is changed. New leader's committed index may not be the cluster's actual committed index until an empty entry is committed. During this period, new leader's committed index may be small than the old leader's. If read_index request is handled, it may read an old index which contains stale values.
cc @siddontang