Remove some configs
This commit is contained in:
parent
945122190e
commit
c0925ffb92
@ -209,12 +209,6 @@
|
|||||||
# env var: LOTUS_CLUSTER_CLUSTERMODEENABLED
|
# env var: LOTUS_CLUSTER_CLUSTERMODEENABLED
|
||||||
#ClusterModeEnabled = false
|
#ClusterModeEnabled = false
|
||||||
|
|
||||||
# will shutdown libp2p host on shutdown. Useful for testing
|
|
||||||
#
|
|
||||||
# type: bool
|
|
||||||
# env var: LOTUS_CLUSTER_HOSTSHUTDOWN
|
|
||||||
#HostShutdown = false
|
|
||||||
|
|
||||||
# A folder to store Raft's data.
|
# A folder to store Raft's data.
|
||||||
#
|
#
|
||||||
# type: string
|
# type: string
|
||||||
@ -263,12 +257,6 @@
|
|||||||
# env var: LOTUS_CLUSTER_BACKUPSROTATE
|
# env var: LOTUS_CLUSTER_BACKUPSROTATE
|
||||||
#BackupsRotate = 6
|
#BackupsRotate = 6
|
||||||
|
|
||||||
# Namespace to use when writing keys to the datastore
|
|
||||||
#
|
|
||||||
# type: string
|
|
||||||
# env var: LOTUS_CLUSTER_DATASTORENAMESPACE
|
|
||||||
#DatastoreNamespace = "/raft"
|
|
||||||
|
|
||||||
# Tracing enables propagation of contexts across binary boundaries.
|
# Tracing enables propagation of contexts across binary boundaries.
|
||||||
#
|
#
|
||||||
# type: bool
|
# type: bool
|
||||||
|
@ -20,15 +20,12 @@ var (
|
|||||||
DefaultNetworkTimeout = 100 * time.Second
|
DefaultNetworkTimeout = 100 * time.Second
|
||||||
DefaultCommitRetryDelay = 200 * time.Millisecond
|
DefaultCommitRetryDelay = 200 * time.Millisecond
|
||||||
DefaultBackupsRotate = 6
|
DefaultBackupsRotate = 6
|
||||||
DefaultDatastoreNamespace = "/r"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ClusterRaftConfig allows to configure the Raft Consensus component for the node cluster.
|
// ClusterRaftConfig allows to configure the Raft Consensus component for the node cluster.
|
||||||
type ClusterRaftConfig struct {
|
type ClusterRaftConfig struct {
|
||||||
// config to enabled node cluster with raft consensus
|
// config to enabled node cluster with raft consensus
|
||||||
ClusterModeEnabled bool
|
ClusterModeEnabled bool
|
||||||
// will shutdown libp2p host on shutdown. Useful for testing
|
|
||||||
HostShutdown bool
|
|
||||||
// A folder to store Raft's data.
|
// A folder to store Raft's data.
|
||||||
DataFolder string
|
DataFolder string
|
||||||
// InitPeerset provides the list of initial cluster peers for new Raft
|
// InitPeerset provides the list of initial cluster peers for new Raft
|
||||||
@ -49,9 +46,6 @@ type ClusterRaftConfig struct {
|
|||||||
// BackupsRotate specifies the maximum number of Raft's DataFolder
|
// BackupsRotate specifies the maximum number of Raft's DataFolder
|
||||||
// copies that we keep as backups (renaming) after cleanup.
|
// copies that we keep as backups (renaming) after cleanup.
|
||||||
BackupsRotate int
|
BackupsRotate int
|
||||||
// Namespace to use when writing keys to the datastore
|
|
||||||
DatastoreNamespace string
|
|
||||||
|
|
||||||
// A Hashicorp Raft's configuration object.
|
// A Hashicorp Raft's configuration object.
|
||||||
RaftConfig *hraft.Config
|
RaftConfig *hraft.Config
|
||||||
|
|
||||||
@ -68,7 +62,6 @@ func DefaultClusterRaftConfig() *ClusterRaftConfig {
|
|||||||
cfg.CommitRetries = DefaultCommitRetries
|
cfg.CommitRetries = DefaultCommitRetries
|
||||||
cfg.CommitRetryDelay = DefaultCommitRetryDelay
|
cfg.CommitRetryDelay = DefaultCommitRetryDelay
|
||||||
cfg.BackupsRotate = DefaultBackupsRotate
|
cfg.BackupsRotate = DefaultBackupsRotate
|
||||||
cfg.DatastoreNamespace = DefaultDatastoreNamespace
|
|
||||||
cfg.RaftConfig = hraft.DefaultConfig()
|
cfg.RaftConfig = hraft.DefaultConfig()
|
||||||
|
|
||||||
// These options are imposed over any Default Raft Config.
|
// These options are imposed over any Default Raft Config.
|
||||||
@ -89,7 +82,6 @@ func NewClusterRaftConfig(userRaftConfig *config.UserRaftConfig) *ClusterRaftCon
|
|||||||
cfg.CommitRetries = userRaftConfig.CommitRetries
|
cfg.CommitRetries = userRaftConfig.CommitRetries
|
||||||
cfg.CommitRetryDelay = time.Duration(userRaftConfig.CommitRetryDelay)
|
cfg.CommitRetryDelay = time.Duration(userRaftConfig.CommitRetryDelay)
|
||||||
cfg.BackupsRotate = userRaftConfig.BackupsRotate
|
cfg.BackupsRotate = userRaftConfig.BackupsRotate
|
||||||
cfg.DatastoreNamespace = userRaftConfig.DatastoreNamespace
|
|
||||||
|
|
||||||
// Keep this to be default hraft config for now
|
// Keep this to be default hraft config for now
|
||||||
cfg.RaftConfig = hraft.DefaultConfig()
|
cfg.RaftConfig = hraft.DefaultConfig()
|
||||||
|
@ -276,13 +276,6 @@ func (cc *Consensus) Shutdown(ctx context.Context) error {
|
|||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cc.config.HostShutdown {
|
|
||||||
err = cc.host.Close()
|
|
||||||
if err != nil {
|
|
||||||
logger.Error(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cc.cancel()
|
cc.cancel()
|
||||||
close(cc.rpcReady)
|
close(cc.rpcReady)
|
||||||
return nil
|
return nil
|
||||||
|
@ -296,7 +296,6 @@ var (
|
|||||||
DefaultNetworkTimeout = 100 * time.Second
|
DefaultNetworkTimeout = 100 * time.Second
|
||||||
DefaultCommitRetryDelay = 200 * time.Millisecond
|
DefaultCommitRetryDelay = 200 * time.Millisecond
|
||||||
DefaultBackupsRotate = 6
|
DefaultBackupsRotate = 6
|
||||||
DefaultDatastoreNamespace = "/raft"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func DefaultUserRaftConfig() *UserRaftConfig {
|
func DefaultUserRaftConfig() *UserRaftConfig {
|
||||||
@ -308,7 +307,6 @@ func DefaultUserRaftConfig() *UserRaftConfig {
|
|||||||
cfg.CommitRetries = DefaultCommitRetries
|
cfg.CommitRetries = DefaultCommitRetries
|
||||||
cfg.CommitRetryDelay = Duration(DefaultCommitRetryDelay)
|
cfg.CommitRetryDelay = Duration(DefaultCommitRetryDelay)
|
||||||
cfg.BackupsRotate = DefaultBackupsRotate
|
cfg.BackupsRotate = DefaultBackupsRotate
|
||||||
cfg.DatastoreNamespace = DefaultDatastoreNamespace
|
|
||||||
|
|
||||||
return &cfg
|
return &cfg
|
||||||
}
|
}
|
||||||
|
@ -1217,12 +1217,6 @@ Default is 20 (about once a week).`,
|
|||||||
|
|
||||||
Comment: `EXPERIMENTAL. config to enabled node cluster with raft consensus`,
|
Comment: `EXPERIMENTAL. config to enabled node cluster with raft consensus`,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "HostShutdown",
|
|
||||||
Type: "bool",
|
|
||||||
|
|
||||||
Comment: `will shutdown libp2p host on shutdown. Useful for testing`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "DataFolder",
|
Name: "DataFolder",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
@ -1271,12 +1265,6 @@ we give up.`,
|
|||||||
Comment: `BackupsRotate specifies the maximum number of Raft's DataFolder
|
Comment: `BackupsRotate specifies the maximum number of Raft's DataFolder
|
||||||
copies that we keep as backups (renaming) after cleanup.`,
|
copies that we keep as backups (renaming) after cleanup.`,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "DatastoreNamespace",
|
|
||||||
Type: "string",
|
|
||||||
|
|
||||||
Comment: `Namespace to use when writing keys to the datastore`,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Name: "Tracing",
|
Name: "Tracing",
|
||||||
Type: "bool",
|
Type: "bool",
|
||||||
|
@ -605,8 +605,6 @@ type FeeConfig struct {
|
|||||||
type UserRaftConfig struct {
|
type UserRaftConfig struct {
|
||||||
// EXPERIMENTAL. config to enabled node cluster with raft consensus
|
// EXPERIMENTAL. config to enabled node cluster with raft consensus
|
||||||
ClusterModeEnabled bool
|
ClusterModeEnabled bool
|
||||||
// will shutdown libp2p host on shutdown. Useful for testing
|
|
||||||
HostShutdown bool
|
|
||||||
// A folder to store Raft's data.
|
// A folder to store Raft's data.
|
||||||
DataFolder string
|
DataFolder string
|
||||||
// InitPeersetMultiAddr provides the list of initial cluster peers for new Raft
|
// InitPeersetMultiAddr provides the list of initial cluster peers for new Raft
|
||||||
@ -627,8 +625,6 @@ type UserRaftConfig struct {
|
|||||||
// BackupsRotate specifies the maximum number of Raft's DataFolder
|
// BackupsRotate specifies the maximum number of Raft's DataFolder
|
||||||
// copies that we keep as backups (renaming) after cleanup.
|
// copies that we keep as backups (renaming) after cleanup.
|
||||||
BackupsRotate int
|
BackupsRotate int
|
||||||
// Namespace to use when writing keys to the datastore
|
|
||||||
DatastoreNamespace string
|
|
||||||
// Tracing enables propagation of contexts across binary boundaries.
|
// Tracing enables propagation of contexts across binary boundaries.
|
||||||
Tracing bool
|
Tracing bool
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user