-
Notifications
You must be signed in to change notification settings - Fork 275
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
Do not exec into pods during rolling update #308
Conversation
Why do we even try to run |
@mkuratczyk as we discussed this morning, you're right, we should only exec into the container to enable/disable plugins if the plugins ConfigMap is changed. We can and should still use the same guards as in this PR to only exec if all replicas are ready and not in the middle of a rolling update. |
@Gsantomaggio that's desired behaviour. You changed the configmap directly (e.g. via You should instead apply the RabbitMQ Custom Resource setting the apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
...
spec:
rabbitmq:
additionalConfig: |
queue_master_locator = random
cluster_formation.node_cleanup.interval = 50 |
37200e7
to
5a28d29
Compare
Ok, thank you @ansd So why does the operator reboot the pod when the config map is changed? |
Hey @Gsantomaggio 🙂 Whenever the configuration is updated, the operator restarts the StatefulSet. That's desired behaviour because https://www.rabbitmq.com/configure.html states that
This logic happens in
In your specific case, you're right that the operator unnecessarily restarts the StatefulSet. So that's a side effect of changing the configuration in the wrong way. |
5a28d29
to
6e8f8b1
Compare
Relates to #304 Before this commit, the controller exec'ed into every RabbitMQ cluster pod in every reconcile loop to idempotently 'rabbitmq-plugins set'. Although simple and correct, these were unnecessary and expensive operations. After this commit, the controller only execs into the pods if the plugins config map got updated.
Because importing an internal library into the tests guarantees that the test will always pass; this weakens the test slightly, as we want this test to become red if we change the resource name because it would be a user facing change i.e. a change in the expectation of what our product creates.
6e8f8b1
to
f29f6bb
Compare
I made the change in the system tests to not import the internal library and use a test constant. Given that we are 3 people at the moment and 2/3 have reviewed this, I will merge the PR when the checks pass. |
This closes #304
Exec into pods only if StatefulSet is ready and up to date.
Before this commit, we observed in #304 that the controller tried to exec into pods at the same time as the pods got updated due to a StatefulSet restart resulting in connection errors.
The main change is to not set plugins if
because during a StatefulSet restart, it happened multiple times in #304 that since
sts.Status.ReadyReplicas == desiredReplicas
, theexec
commands got executed and the connection got interrupted because the pod got updated.The main finding is that
sts.Status.ReadyReplicas == desiredReplicas
can betrue
although the StatefulSet rolling update is still ongoing:Thank you @Gsantomaggio for helping troubleshooting 🙂