mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: not load dummy entry from the wal
This commit is contained in:
parent
65ad1f6ffd
commit
185d37c333
@ -270,7 +270,7 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
|
||||
if cfg.ShouldDiscover() {
|
||||
log.Printf("etcdserver: warn: ignoring discovery: etcd has already been initialized and has a valid log in %q", cfg.WALDir())
|
||||
}
|
||||
index := uint64(1)
|
||||
var index uint64
|
||||
snapshot, err := ss.Load()
|
||||
if err != nil && err != snap.ErrNoSnapshot {
|
||||
return nil, err
|
||||
@ -286,9 +286,9 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
|
||||
log.Printf("etcdserver: loaded peers from snapshot: %s", cfg.Cluster)
|
||||
}
|
||||
if !cfg.ForceNewCluster {
|
||||
id, n, s, w = restartNode(cfg, index, snapshot)
|
||||
id, n, s, w = restartNode(cfg, index+1, snapshot)
|
||||
} else {
|
||||
id, n, s, w = restartAsStandaloneNode(cfg, index, snapshot)
|
||||
id, n, s, w = restartAsStandaloneNode(cfg, index+1, snapshot)
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported bootstrap config")
|
||||
|
Loading…
x
Reference in New Issue
Block a user