Skip to content

Commit

Permalink
embed: do not corrupt-check on fresh member
Browse files Browse the repository at this point in the history
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Nov 22, 2017
1 parent bb7e7a7 commit 5981c45
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions embed/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
urlsmap types.URLsMap
token string
)
needCorruptCheck := true
if !isMemberInitialized(cfg) {
// newly started member does not need corruption check
needCorruptCheck = false
urlsmap, token, err = cfg.PeerURLsMapAndToken("etcd")
if err != nil {
return e, fmt.Errorf("error setting up initial cluster: %v", err)
Expand Down Expand Up @@ -185,8 +188,10 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
// buffer channel so goroutines on closed connections won't wait forever
e.errc = make(chan error, len(e.Peers)+len(e.Clients)+2*len(e.sctxs))

if err = e.Server.CheckInitialHashKV(); err != nil {
return e, err
if needCorruptCheck {
if err = e.Server.CheckInitialHashKV(); err != nil {
return e, err
}
}
e.Server.Start()

Expand Down

0 comments on commit 5981c45

Please sign in to comment.