@@ -478,14 +478,14 @@ func (nh *NodeHost) Stop() {
478478// cluster.
479479//
480480// As a summary, when -
481- // - starting a brand new Raft cluster, set join to false and specify all initial
482- // member node details in the initialMembers map.
483- // - joining a new node to an existing Raft cluster, set join to true and leave
484- // the initialMembers map empty. This requires the joining node to have already
485- // been added as a member node of the Raft cluster.
486- // - restarting an crashed or stopped node, set join to false and leave the
487- // initialMembers map to be empty. This applies to both initial member nodes
488- // and those joined later.
481+ // - starting a brand new Raft cluster, set join to false and specify all initial
482+ // member node details in the initialMembers map.
483+ // - joining a new node to an existing Raft cluster, set join to true and leave
484+ // the initialMembers map empty. This requires the joining node to have already
485+ // been added as a member node of the Raft cluster.
486+ // - restarting an crashed or stopped node, set join to false and leave the
487+ // initialMembers map to be empty. This applies to both initial member nodes
488+ // and those joined later.
489489func (nh * NodeHost ) StartCluster (initialMembers map [uint64 ]Target ,
490490 join bool , create sm.CreateStateMachineFunc , cfg config.Config ) error {
491491 cf := func (clusterID uint64 , nodeID uint64 ,
@@ -1520,17 +1520,17 @@ func (nh *NodeHost) getClusterSetIndex() uint64 {
15201520
15211521// there are three major reasons to bootstrap the cluster
15221522//
1523- // 1. when possible, we check whether user incorrectly specified parameters
1524- // for the startCluster method, e.g. call startCluster with join=true first,
1525- // then restart the NodeHost instance and call startCluster again with
1526- // join=false and len(nodes) > 0
1527- // 2. when restarting a node which is a part of the initial cluster members,
1528- // for user convenience, we allow the caller not to provide the details of
1529- // initial members. when the initial cluster member info is required, however
1530- // we still need to get the initial member info from somewhere. bootstrap is
1531- // the procedure that records such info.
1532- // 3. the bootstrap record is used as a marker record in our default LogDB
1533- // implementation to indicate that a certain node exists here
1523+ // 1. when possible, we check whether user incorrectly specified parameters
1524+ // for the startCluster method, e.g. call startCluster with join=true first,
1525+ // then restart the NodeHost instance and call startCluster again with
1526+ // join=false and len(nodes) > 0
1527+ // 2. when restarting a node which is a part of the initial cluster members,
1528+ // for user convenience, we allow the caller not to provide the details of
1529+ // initial members. when the initial cluster member info is required, however
1530+ // we still need to get the initial member info from somewhere. bootstrap is
1531+ // the procedure that records such info.
1532+ // 3. the bootstrap record is used as a marker record in our default LogDB
1533+ // implementation to indicate that a certain node exists here
15341534func (nh * NodeHost ) bootstrapCluster (initialMembers map [uint64 ]Target ,
15351535 join bool , cfg config.Config ,
15361536 smType pb.StateMachineType ) (map [uint64 ]string , bool , error ) {
@@ -1999,6 +1999,8 @@ func getRequestState(ctx context.Context, rs *RequestState) (sm.Result, error) {
19991999 return sm.Result {}, ErrClusterClosed
20002000 } else if r .Dropped () {
20012001 return sm.Result {}, ErrClusterNotReady
2002+ } else if r .Aborted () {
2003+ return sm.Result {}, ErrAborted
20022004 }
20032005 plog .Panicf ("unknown v code %v" , r )
20042006 case <- ctx .Done ():
0 commit comments