-
Notifications
You must be signed in to change notification settings - Fork 124
bugfix/CSPL-466: If in IndexerCluster spec, replicas < RF(which is configured on ClusterMaster), then set replicas=RF. #166
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
Conversation
…nfigured on ClusterMaster), then set replicas=RF.
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))) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
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.