-
Notifications
You must be signed in to change notification settings - Fork 147
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
K8SPSMDB-675: allow enabling/disabling sharding on a running cluster #1706
Conversation
@@ -57,7 +59,9 @@ const ( | |||
|
|||
// CheckNSetDefaults sets default options, overwrites wrong settings | |||
// and checks if other options' values valid | |||
func (cr *PerconaServerMongoDB) CheckNSetDefaults(platform version.Platform, log logr.Logger) error { | |||
func (cr *PerconaServerMongoDB) CheckNSetDefaults(ctx context.Context, platform version.Platform) error { | |||
log := logf.FromContext(ctx) |
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.
do we use it anywhere?
@@ -262,6 +262,8 @@ const ( | |||
AppStatePaused AppState = "paused" | |||
AppStateReady AppState = "ready" | |||
AppStateError AppState = "error" | |||
|
|||
AppStateSharding AppState = "sharding" |
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.
i don't think this should be type AppState
but I know that we use a custom condition struct rather than using the one exported from meta/v1
. we need to start using it in near future
pkg/apis/psmdb/v1/psmdb_types.go
Outdated
ConditionEnabled ConditionStatus = "Enabled" | ||
ConditionDisabled ConditionStatus = "Disabled" |
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.
can't we use ConditionTrue
and ConditionFalse
instead of these?
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.
for i, cond := range s.Conditions { | ||
if cond.Type != c.Type { | ||
continue | ||
} | ||
s.Conditions[i] = c | ||
} | ||
s.Conditions = append(s.Conditions, c) |
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.
hmm we're changing our behavior but i think it's OK.
commit: 9945cb5 |
https://perconadev.atlassian.net/browse/K8SPSMDB-675
DESCRIPTION
Problem:
If backup is enabled, it is not possible to switch the
spec.sharding.enabled
setting because PBM is unable to detect the change.Solution:
When backup is enabled and a change is made to
spec.sharding.enabled
, the operator will first pause the cluster. During this pause, the statefulsets will be updated. After the updates are complete, the operator will then unpause the cluster.CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability