Skip to content

Commit

Permalink
golint: Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
  • Loading branch information
Mathieu Borderé committed Apr 26, 2022
1 parent 11e7998 commit 2322814
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ type Node struct {
// NodeInfo is a convenience alias for client.NodeInfo.
type NodeInfo = client.NodeInfo

// Expose bindings.SnapshotParams. Used for setting dqlite's snapshot parameters.
// SnapshotParams exposes bindings.SnapshotParams. Used for setting dqlite's
// snapshot parameters.
// SnapshotParams.Threshold controls after how many raft log entries a snapshot is
// taken. The higher this number, the lower the frequency of the snapshots.
// SnapshotParams.Trailing controls how many raft log entries are retained after
Expand Down Expand Up @@ -191,6 +192,14 @@ func ReconfigureMembership(dir string, cluster []NodeInfo) error {
return server.Recover(cluster)
}

// ReconfigureMembershipExt can be used to recover a cluster whose majority of
// nodes have died, and therefore has become unavailable.
//
// It forces appending a new configuration to the raft log stored in the given
// directory, effectively replacing the current configuration.
// In comparision with ReconfigureMembership, this function takes the node role
// into account and makes use of a dqlite API that supports extending the
// NodeInfo struct.
func ReconfigureMembershipExt(dir string, cluster []NodeInfo) error {
server, err := bindings.NewNode(context.Background(), 1, "1", dir)
if err != nil {
Expand Down

0 comments on commit 2322814

Please sign in to comment.