mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: initial index to 1
This commit is contained in:
parent
453133977d
commit
d69e4dbe6d
@ -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())
|
||||
}
|
||||
var index uint64
|
||||
index := uint64(1)
|
||||
snapshot, err := ss.Load()
|
||||
if err != nil && err != snap.ErrNoSnapshot {
|
||||
return nil, err
|
||||
@ -279,8 +279,6 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
|
||||
log.Printf("etcdserver: recovering from snapshot at index %d", snapshot.Metadata.Index)
|
||||
st.Recovery(snapshot.Data)
|
||||
index = snapshot.Metadata.Index
|
||||
} else {
|
||||
index = 1
|
||||
}
|
||||
cfg.Cluster = NewClusterFromStore(cfg.Cluster.token, st)
|
||||
cfg.Print()
|
||||
|
Loading…
x
Reference in New Issue
Block a user