Skip to content

Commit

Permalink
Remove duplicate log values and remove the check for processes under …
Browse files Browse the repository at this point in the history
…maintenance
  • Loading branch information
johscheuer committed Aug 27, 2024
1 parent a83c6f8 commit 48210ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fdbclient/admin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ type cliAdminClient struct {
}

// NewCliAdminClient generates an Admin client for a cluster
func NewCliAdminClient(cluster *fdbv1beta2.FoundationDBCluster, _ client.Client, log logr.Logger) (fdbadminclient.AdminClient, error) {
func NewCliAdminClient(cluster *fdbv1beta2.FoundationDBCluster, _ client.Client, logger logr.Logger) (fdbadminclient.AdminClient, error) {
clusterFile, err := createClusterFile(cluster)
if err != nil {
return nil, err
}

logger := log.WithValues("namespace", cluster.Namespace, "cluster", cluster.Name)
return &cliAdminClient{
Cluster: cluster,
clusterFilePath: clusterFile,
Expand Down
13 changes: 11 additions & 2 deletions internal/locality/locality.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,17 @@ func CheckCoordinatorValidity(logger logr.Logger, cluster *fdbv1beta2.Foundation
coordinatorAddress = dnsAddress.String()
}

if coordinatorAddress != "" && !process.Excluded && !process.UnderMaintenance {
coordinatorStatus[coordinatorAddress] = true
if coordinatorAddress != "" {
if process.Excluded {
pLogger.Info("Coordinator process is excluded, marking it as unhealthy", "class", process.ProcessClass, "address", coordinatorAddress)
} else {
// The process is not excluded and has an address, so we assume that the coordinator is healthy.
coordinatorStatus[coordinatorAddress] = true
}

if process.UnderMaintenance {
pLogger.Info("Coordinator process is under maintenance", "class", process.ProcessClass, "address", coordinatorAddress)
}
}

if coordinatorAddress != "" {
Expand Down

0 comments on commit 48210ff

Please sign in to comment.