fix(server-groups): evict stale cached ids#1053
Open
Rico Lin (ricolin) wants to merge 2 commits into
Open
Conversation
Rico Lin (ricolin)
added a commit
that referenced
this pull request
May 29, 2026
PR #1053 changes server-group cache behavior. Configure the shared OpenStack client mock to return real string IDs for created server groups so the disk-backed cache can serialize nodegroup test data instead of trying to pickle a MagicMock id. Signed-off-by: Rico Lin <rico@vexxhost.com> Assisted-By: ChatGPT <noreply@openai.com>
Verify cached server group IDs against Nova before reusing them and clear cache entries after successful or already-missing server group deletes. This prevents nodegroup recreation from rendering an immutable OpenStackMachineTemplate with a deleted server group ID. Assisted-By: ChatGPT <noreply@openai.com> Signed-off-by: Rico Lin <rlin@vexxhost.com>
PR #1053 changes server-group cache behavior. Configure the shared OpenStack client mock to return real string IDs for created server groups so the disk-backed cache can serialize nodegroup test data instead of trying to pickle a MagicMock id. Assisted-By: ChatGPT <noreply@openai.com> Signed-off-by: Rico Lin <rlin@vexxhost.com>
Rico Lin (ricolin)
added a commit
that referenced
this pull request
May 29, 2026
PR #1053 changes server-group cache behavior. Configure the shared OpenStack client mock to return real string IDs for created server groups so the disk-backed cache can serialize nodegroup test data instead of trying to pickle a MagicMock id. Signed-off-by: Rico Lin <rico@vexxhost.com> Assisted-By: ChatGPT <noreply@openai.com> Signed-off-by: ricolin <rlin@vexxhost.com>
52b44bc to
2678280
Compare
Rico Lin (ricolin)
added a commit
that referenced
this pull request
Jun 16, 2026
PR #1053 changes server-group cache behavior. Configure the shared OpenStack client mock to return real string IDs for created server groups so the disk-backed cache can serialize nodegroup test data instead of trying to pickle a MagicMock id. Signed-off-by: Rico Lin <rlin@vexxhost.com> Assisted-By: ChatGPT <noreply@openai.com> Signed-off-by: ricolin <rlin@vexxhost.com>
fd14339 to
1b55a98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root Cause
Nodegroup recreation can happen quickly after a worker nodegroup delete. The previous server group ID may still be cached by
(project_id, server_group_name)even after the Nova server group has been deleted. Reusing that stale ID renders an immutable CAPIOpenStackMachineTemplatewith a server group Nova no longer has, causing worker server creation to fail.Validation
uv run pytest magnum_cluster_api/tests/unit/test_utils.py -k 'server_group'-> 4 passedgit diff --checkNotes
A broader
uv run pytest magnum_cluster_api/tests/unit/test_utils.pycurrently fails on an existing cloud-controller config expectation: the test expectslb-provider=amphora, while current code rendersamphorav2. That failure is outside this server-group cache fix.