Skip to content

Conversation

gaurav-splunk
Copy link
Collaborator

Problem
In case if IndexerCluster spec has replicas < replication_factor or site_replication_factor as set on ClusterMaster, then IndexerCluster goes in the reconcilation loop since CM is never in Ready state. And the only way to scale indexer cluster is using kubectl scale statefulset .....

Solution
Set replicas = RF if it is less than RF.

@smohan-splunk
Copy link
Contributor

Can we update the documentation as part of this PR to indicate the Operator's corrective measures when replicas<RF?

// Negative testing with non-integer version
for testVersion := 0; testVersion < 10; testVersion++ {
testSecretName = splcommon.GetVersionedSecretName(versionedSecretIdentifier, string('A'-1+testVersion))
testSecretName = splcommon.GetVersionedSecretName(versionedSecretIdentifier, string(rune('A'-1+testVersion)))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to use rune to fix a compilation error if using go version >=1.15. This was the error when we ran make test -
pkg/splunk/util/secrets_test.go:431:80: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

}

if mgr.cr.Spec.Replicas < replicationFactor {
mgr.log.Info("Changing number of replicas as it is less than RF number of peers", "replicas", mgr.cr.Spec.Replicas)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: Maybe can change the logging to something like "Increasing number of indexer replicas to match RF number of peers" or something similar

@smohan-splunk smohan-splunk merged commit b324ae6 into develop Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants