Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "PWX-39445: Option to disable quorum in gossip" #2501

Open
wants to merge 1 commit into
base: release-9.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions api/client/cluster/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,15 @@ func (c *clusterClient) Shutdown() error {
return nil
}

func (c *clusterClient) Start(bool, string, string, bool) error {
func (c *clusterClient) Start(bool, string, string) error {
return nil
}

func (c *clusterClient) Uuid() string {
return ""
}

func (c *clusterClient) StartWithConfiguration(
bool, string, []string, string, *cluster.ClusterServerConfiguration, string, bool,
) error {
func (c *clusterClient) StartWithConfiguration(bool, string, []string, string, *cluster.ClusterServerConfiguration, string) error {
return nil
}

Expand Down
10 changes: 1 addition & 9 deletions cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,7 @@ type Cluster interface {
// nodeInitialized indicates if the caller of this method expects the node
// to have been in an already-initialized state.
// All managers will default returning NotSupported.
Start(
nodeInitialized bool,
gossipPort string,
selfClusterDomain string,
// disableQuorum if true will disable the cluster quorum requirement in gossip
disableQuorum bool,
) error
Start(nodeInitialized bool, gossipPort string, selfClusterDomain string) error

// Like Start, but have the ability to pass in managers to the cluster object
StartWithConfiguration(
Expand All @@ -384,8 +378,6 @@ type Cluster interface {
selfClusterDomain string,
config *ClusterServerConfiguration,
gobRegisterName string,
// disableQuorum if true will disable the cluster quorum requirement in gossip
disableQuorum bool,
) error

// Get a unique identifier for this cluster. Depending on the implementation, this could
Expand Down
6 changes: 2 additions & 4 deletions cluster/cluster_not_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ func (m *NullClusterManager) Shutdown() error {
}

// Start
func (m *NullClusterManager) Start(arg1 bool, arg2 string, arg3 string, arg4 bool) error {
func (m *NullClusterManager) Start(arg1 bool, arg2 string, arg3 string) error {
return ErrNotImplemented
}

// StartWithConfiguration
func (m *NullClusterManager) StartWithConfiguration(
arg1 bool, arg2 string, arg3 []string, arg4 string, arg5 *ClusterServerConfiguration, arg6 string, arg7 bool,
) error {
func (m *NullClusterManager) StartWithConfiguration(arg1 bool, arg2 string, arg3 []string, arg4 string, arg5 *ClusterServerConfiguration, arg6 string) error {
return ErrNotImplemented
}

Expand Down
21 changes: 5 additions & 16 deletions cluster/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ type ClusterManager struct {
selfClusterDomain string
// kvdbWatchIndex stores the kvdb index to start the watch
kvdbWatchIndex uint64
// disableQuorum if true will disable the cluster quorum requirement in gossip
disableQuorum bool
}

// Init instantiates a new cluster manager.
Expand Down Expand Up @@ -848,13 +846,11 @@ func (c *ClusterManager) startHeartBeat(
logrus.Infof("Starting Gossip...")
}

quorumProvider := types.QUORUM_PROVIDER_DEFAULT
if c.disableQuorum {
quorumProvider = types.QUORUM_PROVIDER_NOOP
} else if len(activeMap) > 0 {
quorumProvider = types.QUORUM_PROVIDER_FAILURE_DOMAINS
if len(activeMap) > 0 {
gossipConfig.QuorumProviderType = types.QUORUM_PROVIDER_FAILURE_DOMAINS
} else {
gossipConfig.QuorumProviderType = types.QUORUM_PROVIDER_DEFAULT
}
gossipConfig.QuorumProviderType = quorumProvider

c.gossip.Start(gossipConfig)
c.gossip.UpdateCluster(c.getNonDecommisionedPeers(*clusterInfo))
Expand Down Expand Up @@ -1211,9 +1207,6 @@ func (c *ClusterManager) initializeCluster(db kvdb.Kvdb) (
}

func (c *ClusterManager) quorumMember() bool {
if c.disableQuorum {
return false
}
if c.listeners.Len() == 0 {
// If there are no listeners registered by the driver, assume
// this node is a quorum member, so this becomes the default behavior
Expand Down Expand Up @@ -1449,16 +1442,14 @@ func (c *ClusterManager) Start(
nodeInitialized bool,
gossipPort string,
selfClusterDomain string,
disableQuorum bool,
) error {
return c.StartWithConfiguration(
nodeInitialized,
gossipPort,
[]string{ClusterDBKey},
selfClusterDomain,
&cluster.ClusterServerConfiguration{},
"",
disableQuorum)
"")
}

func (c *ClusterManager) StartWithConfiguration(
Expand All @@ -1468,7 +1459,6 @@ func (c *ClusterManager) StartWithConfiguration(
selfClusterDomain string,
config *cluster.ClusterServerConfiguration,
gobRegisterName string,
disableQuorum bool,
) error {
var err error

Expand Down Expand Up @@ -1551,7 +1541,6 @@ func (c *ClusterManager) StartWithConfiguration(
)
c.gossipVersion = types.GOSSIP_VERSION_2

c.disableQuorum = disableQuorum
var exist bool
lastIndex, clusterInfo, err := c.initializeAndStartHeartbeat(
kv,
Expand Down
2 changes: 1 addition & 1 deletion cluster/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestUpdateSchedulerNodeName(t *testing.T) {

err = inst.StartWithConfiguration(false, "1001", []string{}, "", &cluster.ClusterServerConfiguration{
ConfigSystemTokenManager: manager,
}, "gobRegisterName/path", false)
}, "gobRegisterName/path")
assert.NoError(t, err)

node, err := inst.Inspect(nodeID)
Expand Down
16 changes: 8 additions & 8 deletions cluster/mock/cluster.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cmd/osd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ func start(c *cli.Context) error {
ConfigSystemTokenManager: auth.SystemTokenManagerInst(),
},
"",
false,
); err != nil {
return fmt.Errorf("Unable to start cluster manager: %v", err)
}
Expand Down
5 changes: 0 additions & 5 deletions vendor/github.com/gobuffalo/envy/.env

This file was deleted.

139 changes: 139 additions & 0 deletions vendor/github.com/libopenstorage/gossip/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions vendor/github.com/libopenstorage/gossip/Gopkg.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions vendor/github.com/libopenstorage/gossip/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading