mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: restore ability to bootstrap RawNode
We are worried about breaking backwards compatibility for any application out there that may have relied on the old behavior. Their RawNode invocation would have been broken by the removal of the peers argument so it would not have changed silently; an associated comment tells callers how to fix it.
This commit is contained in:
@@ -38,6 +38,12 @@ type RawNode struct {
|
||||
}
|
||||
|
||||
// NewRawNode instantiates a RawNode from the given configuration.
|
||||
//
|
||||
// See Bootstrap() for bootstrapping an initial state; this replaces the former
|
||||
// 'peers' argument to this method (with identical behavior). However, It is
|
||||
// recommended that instead of calling Bootstrap, applications bootstrap their
|
||||
// state manually by setting up a Storage that has a first index > 1 and which
|
||||
// stores the desired ConfState as its InitialState.
|
||||
func NewRawNode(config *Config) (*RawNode, error) {
|
||||
if config.ID == 0 {
|
||||
panic("config.ID must not be zero")
|
||||
|
||||
Reference in New Issue
Block a user