mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

The first Ready after RestartNode (with no snapshot) will have no unstable entries, so we don't have the correct prevLastUnstablei when Advance is called. This would cause raftLog.unstable to move backwards and previously-stable entries would be returned to the application again. This should have been caught by the "unexpected Ready" portion of TestNodeRestart, but it went unnoticed because the Node's goroutine takes some time to read from advancec and prepare the write to read to readyc. Added a small (1ms) delay to all such tests to ensure that the goroutine has time to enter its select wait.