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

Patch: Fix patches that incorrectly depend on cluster member being leader #13189

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

roosterfish
Copy link
Contributor

This PR is a follow up on #13162 to fix the leader election also for patchStorageRenameCustomISOBlockVolumes and patchStorageUnsetInvalidBlockSettings.

A new function selectedPatchClusterMember is added which offers a deterministic approach to select a single member across the cluster which is eligible to apply the patch. For example this is necessary for the patch patchStorageRenameCustomISOBlockVolumes which interferes with the storage subsystem.

The patch patchStorageUnsetInvalidBlockSettings is superseded by a single idempotent query that can now run multiple times on all cluster members.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@roosterfish
Copy link
Contributor Author

@tomponline do you want me to fix it also for patchDBNodesAutoInc or should we leave it there for historical reasons since it's not affected by the bug?

I put the reworked patches alongside there parents to keep them together and not at the end of the file.

@tomponline
Copy link
Member

@tomponline do you want me to fix it also for patchDBNodesAutoInc or should we leave it there for historical reasons since it's not affected by the bug?

No, lets leave that one well alone.

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

The patches var definition says:

Only append to the patches list, never remove entries and never re-order them.

lxd/patches.go Outdated Show resolved Hide resolved
lxd/patches.go Outdated Show resolved Hide resolved
@tomponline tomponline changed the title Patch: Fix leader election in older patches Patch: Fix patches that incorrectly depend on cluster member being leader Mar 21, 2024
Supersedes patchStorageRenameCustomISOBlockVolumes by using the new patch cluster member selection

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Supersedes patchStorageUnsetInvalidBlockSettings by using a single idempotent SQL query

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@roosterfish
Copy link
Contributor Author

The patches var definition says:

Only append to the patches list, never remove entries and never re-order them.

Mhh ok haven't seen this, it felt wrong doing it but I thought if the original patch gets emptied out, and its replacement is executed at the end of the list, maybe it might cause side effects with other patches.

@tomponline tomponline merged commit 51efacc into canonical:main Mar 21, 2024
28 checks passed
@roosterfish roosterfish deleted the fix_patch_leader branch March 21, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants