goraft / raft

UNMAINTAINED: A Go implementation of the Raft distributed consensus protocol.
MIT License
2.43k stars 479 forks source link

bugfix, return err when readConf() failed #228

Open wankai opened 10 years ago

wankai commented 10 years ago

an obviously bug in readConf() function

philips commented 10 years ago

lgtm. @xiangli-cmu @unihorn ?

yichengq commented 10 years ago

I guess it might want to filter out io.ErrNotExist. @xiangli-cmu

wankai commented 10 years ago

@unihorn , config is as follow. if config file doesn't exist, peers will be nil, then this raft server will have no idea of others.

type Config struct {
    CommitIndex uint64 `json:"commitIndex"`
    // TODO decide what we need to store in peer struct
    Peers []*Peer `json:"peers"`
}
yichengq commented 10 years ago

@wankai It may be a new raft machine, and doesn't have that file yet.