Skip to content
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

Fix ScyllaDB version upgrade being stuck on Pod staying in maintenance mode #1267

Merged
merged 1 commit into from Jun 9, 2023

Conversation

zimnx
Copy link
Collaborator

@zimnx zimnx commented Jun 1, 2023

Service controller copied maintenance mode label into required object from cached informer when it was present.
Labels are also rewritten from existing objects in all Apply methods. If maitenance mode label was removed in between when required object is constructed, and Apply method is called, it would make it persitently available in the Service object.
Instead adding it to required object, it should be carried over from existing object only in Apply method, because this label is managed by patches.

Fixes #1252

@zimnx zimnx added the kind/bug Categorizes issue or PR as related to a bug. label Jun 1, 2023
@zimnx zimnx added this to the v1.9 milestone Jun 1, 2023
@zimnx zimnx force-pushed the mz/1252-maintenance-mode-fix branch from 9193ace to 73b44b1 Compare June 2, 2023 08:06
@zimnx zimnx changed the title Fix upgrade being stuck on Pod staying in maintenance mode Fix ScyllaDB version upgrade being stuck on Pod staying in maintenance mode Jun 2, 2023
@zimnx zimnx force-pushed the mz/1252-maintenance-mode-fix branch from 73b44b1 to 0d2c8e8 Compare June 2, 2023 08:07
@zimnx zimnx marked this pull request as ready for review June 2, 2023 08:07
@zimnx zimnx requested review from tnozicka and rzetelskik June 2, 2023 08:07
Copy link
Member

@rzetelskik rzetelskik left a comment

Choose a reason for hiding this comment

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

Well done tracking the issue. As for the fix - it's imperative and prone to fail with disruptions, e.g. deleting the service during the upgrade would result in unexpected behaviour. Having said that I don't see a different approach to fixing this without changing the upgrade procedure, but that's something to keep in mind.

oldService: &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
naming.NodeMaintenanceLabel: "42",
Copy link
Member

@rzetelskik rzetelskik Jun 2, 2023

Choose a reason for hiding this comment

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

nit: s/"42"/""
Looks unnecessarily obfuscated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

value doesn't matter, "" is as good as "42". Leaving as is to save CI respins.

Copy link
Member

@tnozicka tnozicka left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@tnozicka tnozicka force-pushed the mz/1252-maintenance-mode-fix branch from 0d2c8e8 to d201b7b Compare June 7, 2023 11:21
@zimnx zimnx enabled auto-merge June 7, 2023 13:42
@zimnx zimnx force-pushed the mz/1252-maintenance-mode-fix branch from d201b7b to 1c05996 Compare June 9, 2023 08:01
…e mode

Service controller copied maintenance mode label into required object
from cached informer when it was present.
Labels are also rewritten from existing objects in all Apply methods.
If maitenance mode label was removed in between when required object is
constructed, and Apply method is called, it would make it persitently
available in the Service object.
Instead adding it to required object, it should be carried over from
existing object only in Apply method, because this label is managed by
patches.

Fixes scylladb#1252
@zimnx zimnx force-pushed the mz/1252-maintenance-mode-fix branch from 1c05996 to 78f142f Compare June 9, 2023 09:51
@zimnx zimnx merged commit db05bf9 into scylladb:master Jun 9, 2023
16 of 17 checks passed
@zimnx zimnx deleted the mz/1252-maintenance-mode-fix branch June 9, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade gets stuck due to maintenance mode not removed after pod recreation
3 participants