-
Notifications
You must be signed in to change notification settings - Fork 21
CLOUDP-349087: Fix TLS disable + scale up test #490
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
base: master
Are you sure you want to change the base?
Conversation
MCK 1.5.0 Release NotesNew Features
Bug Fixes
|
@pytest.mark.e2e_disable_tls_scale_up | ||
def test_tls_is_disabled_and_scaled_up(replica_set: MongoDB): | ||
replica_set.load() | ||
replica_set["spec"]["members"] = 5 |
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.
The issue in the test is that it was doing the update in two steps (scale, and then disable tls), while the whole point is to change them at the same time. (on top of having a duplicate function name)
// Check if TLS is being disabled. If so, we need to lock replicas at the current member count | ||
// to prevent scaling during the TLS disable operation. This decision is made once here and | ||
// applied to both the StatefulSet and OM automation config. | ||
tlsWillBeDisabled, err := checkIfTLSWillBeDisabled(conn, rs, log) |
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.
what if we just block this with validation and say that it's not possible to change both member count and disabling TLS at the same time?
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.
Yes, after discussing it in DM, let's do that instead of adding complexity to the reconcile loop. This is not a common use case anyway.
Summary
This test has been broken for a while. Because there were two functions with the name
test_tls_is_disabled_and_scaled_up
, only one of them was running everytime.I think this scenario has low chance of existing in production, hence why we never had a ticket related to this bug.
On top of that it performed the update in two separate step, whereas to test this behaviour it should be done in one update.
I uncovered it as part of the larger refactoring of the controller. But to keep the PR scope reasonable, I extracted the related changes as they are self contained
The bug may exist in multi-cluster as well. This bug was first discovered in 2021: https://jira.mongodb.org/browse/CLOUDP-80768
The blocking mechanism will be implemented in a better way after the multi-cluster first refactor, since we will keep track of a global reconciler state, notably holding the target number of replicas for this reconciliation.
Proof of Work
In the commit (1d8847e) which just fixes the e2e test, it fails: evg task Showing that the reconciler had to be fixed as well.
The PR is correct if CI is green again.
Checklist
skip-changelog
label if not needed