Skip to content

Commit

Permalink
Update Config struct godoc for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Apr 8, 2021
1 parent aee4d86 commit af6353d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ type Raft struct {
// server. Any further attempts to bootstrap will return an error that can be
// safely ignored.
//
// One sane approach is to bootstrap a single server with a configuration
// One approach is to bootstrap a single server with a configuration
// listing just itself as a Voter, then invoke AddVoter() on it to add other
// servers to the cluster.
func BootstrapCluster(conf *Config, logs LogStore, stable StableStore,
Expand Down
2 changes: 1 addition & 1 deletion commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type commitment struct {
startIndex uint64
}

// newCommitment returns an commitment struct that notifies the provided
// newCommitment returns a commitment struct that notifies the provided
// channel when log entries have been committed. A new commitment struct is
// created each time this server becomes leader for a particular term.
// 'configuration' is the servers in the cluster.
Expand Down
17 changes: 8 additions & 9 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ type Config struct {

// If we are a member of a cluster, and RemovePeer is invoked for the
// local node, then we forget all peers and transition into the follower state.
// If ShutdownOnRemove is is set, we additional shutdown Raft. Otherwise,
// If ShutdownOnRemove is set, we additional shutdown Raft. Otherwise,
// we can become a leader of a cluster containing only this node.
ShutdownOnRemove bool

Expand All @@ -178,8 +178,8 @@ type Config struct {
SnapshotInterval time.Duration

// SnapshotThreshold controls how many outstanding logs there must be before
// we perform a snapshot. This is to prevent excessive snapshots when we can
// just replay a small set of logs. The value passed here is the initial
// we perform a snapshot. This is to prevent excessive snapshotting by
// replaying a small set of logs instead. The value passed here is the initial
// setting used. This can be tuned during operation using ReloadConfig.
SnapshotThreshold uint64

Expand All @@ -189,7 +189,7 @@ type Config struct {
// step down as leader.
LeaderLeaseTimeout time.Duration

// The unique ID for this server across all time. When running with
// LocalID is a unique ID for this server across all time. When running with
// ProtocolVersion < 3, you must set this to be the same as the network
// address of your transport.
LocalID ServerID
Expand All @@ -203,19 +203,18 @@ type Config struct {
// Defaults to os.Stderr.
LogOutput io.Writer

// LogLevel represents a log level. If a no matching string is specified,
// hclog.NoLevel is assumed.
// LogLevel represents a log level. If the value does not match a known
// logging level hclog.NoLevel is used.
LogLevel string

// Logger is a user-provided hc-log logger. If nil, a logger writing to
// Logger is a user-provided logger. If nil, a logger writing to
// LogOutput with LogLevel is used.
Logger hclog.Logger

// NoSnapshotRestoreOnStart controls if raft will restore a snapshot to the
// FSM on start. This is useful if your FSM recovers from other mechanisms
// than raft snapshotting. Snapshot metadata will still be used to initialize
// raft's configuration and index values. This is used in NewRaft and
// RestoreCluster.
// raft's configuration and index values.
NoSnapshotRestoreOnStart bool

// skipStartup allows NewRaft() to bypass all background work goroutines
Expand Down

0 comments on commit af6353d

Please sign in to comment.