Skip to content

Commit

Permalink
Merge pull request #35 from aerospike/dbaasdev-1073-quiesce
Browse files Browse the repository at this point in the history
export method to get list of nodes that are quiesced
  • Loading branch information
abhishekdwivedi3060 authored Oct 24, 2023
2 parents f3a555f + d33989b commit e61d6b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions deployment/aeroinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ func InfoQuiesceUndo(log logr.Logger, policy *aero.ClientPolicy, allHosts []*Hos
return c.InfoQuiesceUndo(getHostIDsFromHostConns(allHosts))
}

// GetQuiescedNodes returns a list of node hostIDs of all nodes that are pending_quiesce=true.
func GetQuiescedNodes(log logr.Logger, policy *aero.ClientPolicy, allHosts []*HostConn) ([]string, error) {
c, err := newCluster(log, policy, allHosts, allHosts)
if err != nil {
return nil, fmt.Errorf("unable to create a cluster copy for running aeroinfo: %v", err)
}

return c.getQuiescedNodes(getHostIDsFromHostConns(allHosts))
}

// SetMigrateFillDelay sets the given migrate-fill-delay on all the given cluster nodes
func SetMigrateFillDelay(log logr.Logger, policy *aero.ClientPolicy, allHosts []*HostConn, migrateFillDelay int) error {
c, err := newCluster(log, policy, allHosts, allHosts)
Expand Down
4 changes: 2 additions & 2 deletions deployment/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ func (c *cluster) infoClusterStablePerNamespace(hostIDs, removedNamespaces []str
return nil
}

func (c *cluster) GetQuiescedNodes(hostIDs []string) ([]string, error) {
func (c *cluster) getQuiescedNodes(hostIDs []string) ([]string, error) {
var quiescedNodes []string

namespaces, err := c.getClusterNamespaces(hostIDs)
Expand Down Expand Up @@ -676,7 +676,7 @@ func (c *cluster) InfoQuiesceUndo(hostIDs []string) error {
}

// Fetching quiesced Nodes
quiescedNodes, err := c.GetQuiescedNodes(hostIDs)
quiescedNodes, err := c.getQuiescedNodes(hostIDs)
if err != nil {
return err
}
Expand Down

0 comments on commit e61d6b6

Please sign in to comment.