Closed vickiniu closed 7 years ago
PTAL :)
👀
Previously, restarting the initial node in a cluster would segfault since there was no snapshot to restore from.
Was this true in general or just in the net/raft tests? We produce snapshots pretty infrequently, so when you run a local cored and restart it, most likely it has no snapshot and is booting solely from the write ahead log. That makes me wonder if the bug might be in the state_test.go State implementation.
lgtm
Adds unit tests and a fix for restarting a node in a cluster. Previously, restarting the initial node in a cluster would segfault since there was no snapshot to restore from.
Now, we trigger snapshot while initializing a raft cluster to ensure that we can always restart nodes without errors.