Skip to content

Commit

Permalink
Fix name and use of CORE_CLUSTER_RECOVER_TIMEOUT_SEC
Browse files Browse the repository at this point in the history
  • Loading branch information
ioppermann committed Jul 9, 2024
1 parent e306d20 commit 7879480
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type Cluster interface {
Leave(origin, id string) error // gracefully remove a node from the cluster
TransferLeadership(origin, id string) error // transfer leadership to another node
Snapshot(origin string) (io.ReadCloser, error)
IsRaftLeader() bool
HasRaftLeader() bool

ProcessAdd(origin string, config *app.Config) error
Expand Down
4 changes: 3 additions & 1 deletion cluster/follower.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (c *cluster) establishFollowership(ctx context.Context) {
ctx, cancel := context.WithCancel(ctx)
c.cancelFollowerShip = cancel

go c.recoverCluster(ctx, c.syncInterval)
if c.recoverTimeout > 0 {
go c.recoverCluster(ctx, c.syncInterval)
}
}

func (c *cluster) revokeFollowership() {
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func (d *Config) init() {
d.vars.Register(value.NewInt64(&d.Cluster.SyncInterval, 5), "cluster.sync_interval_sec", "CORE_CLUSTER_SYNC_INTERVAL_SEC", nil, "Interval between aligning the process in the cluster DB with the processes on the nodes", true, false)
d.vars.Register(value.NewInt64(&d.Cluster.NodeRecoverTimeout, 120), "cluster.node_recover_timeout_sec", "CORE_CLUSTER_NODE_RECOVER_TIMEOUT_SEC", nil, "Timeout for a node to recover before rebalancing the processes", true, false)
d.vars.Register(value.NewInt64(&d.Cluster.EmergencyLeaderTimeout, 10), "cluster.emergency_leader_timeout_sec", "CORE_CLUSTER_EMERGENCY_LEADER_TIMEOUT_SEC", nil, "Timeout for establishing the emergency leadership after lost contact to raft leader", true, false)
d.vars.Register(value.NewInt64(&d.Cluster.RecoverTimeout, 0), "cluster.recover_timeout_sec", "CORE_CLUSTER_NODE_RECOVER_TIMEOUT_SECONDS", nil, "Timeout for recovering the cluster if no leader can be voted", false, false)
d.vars.Register(value.NewInt64(&d.Cluster.RecoverTimeout, 0), "cluster.recover_timeout_sec", "CORE_CLUSTER_RECOVER_TIMEOUT_SEC", nil, "Timeout for recovering the cluster if no raft leader can be elected", false, false)
d.vars.Register(value.NewBool(&d.Cluster.Debug.DisableFFmpegCheck, false), "cluster.debug.disable_ffmpeg_check", "CORE_CLUSTER_DEBUG_DISABLE_FFMPEG_CHECK", nil, "Disable checking for identical FFmpeg versions on all nodes", false, false)
}

Expand Down

0 comments on commit 7879480

Please sign in to comment.