-
Notifications
You must be signed in to change notification settings - Fork 59
Delete next cell irrespective of last deletion #901
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
Delete next cell irrespective of last deletion #901
Conversation
|
The jira report says, we need to do this for cellCreation as well, but I think its already taken care of at here https://github.com/openstack-k8s-operators/nova-operator/blob/main/controllers/nova_controller.go#L328-L356 |
mrkisaolamb
left a comment
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.
Please add some func tests for cell deletion to assert if deletion is working and returning errors for all cells. Also it will be nice to assert what are conditions of nova instance
00be5c8 to
832bf37
Compare
b8de3bd to
25cc5c6
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/55d93ec55a534c64a74ed0e2e7f7761a ✔️ openstack-meta-content-provider SUCCESS in 47m 42s |
ea9aefb to
fe73ce1
Compare
gibizer
left a comment
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.
Deletion logic looks good with a small request about ordering. I have couple of comments on the testing side.
| delete(nova.Spec.CellTemplates, "cell2") | ||
| delete(nova.Spec.CellTemplates, "cell3") |
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.
do we know that the deletion of cell2 is always before cell3 in novaCellList.Items at L605 in the controller? If cell3 can be before cell2 then the test below does not prove that the error in cell2 was just collected but not stopped the loop there.
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.
Maybe the way to make it testable is to sort the cells be cell name when iterated in the controller. We do that for cell creation anyhow in #903 to avoid the unstable ordering to cause unstable condition messages.
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 novaCellList is already sorted and cell2 always comes before cell3 in reconciler.
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.
sorted
| g.Expect(nova.Status.RegisteredCells).NotTo(HaveKey(cell3.CellCRName.Name)) | ||
| }, timeout, interval).Should(Succeed()) | ||
|
|
||
| // NovaCellNotExists(cell3.CellCRName) |
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.
yepp you can check if k8s returns not found for cell3 to prove that it is deleted. You can also check that the RegisteredCells list does not contain cell3 any more but still contains cell2.
|
Running the test locally shows that cell2 is also successfully deleted so the current test does not recreate the necessary scenario to prove that failure in one cell does not prevent the deletion of the other. |
fe73ce1 to
6d31959
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/5839fe00e7f1456ba553d6adfcd1e5ee ✔️ openstack-meta-content-provider SUCCESS in 2h 43m 17s |
ddcb2bf to
d046279
Compare
4a961b5 to
20729e2
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/6472550c14a1482fae1096456327090c ✔️ openstack-meta-content-provider SUCCESS in 3h 02m 18s |
|
@auniyal61 so you pinged me on slack about the DeferCleanup issue.
The DeferCleanup doc says:
So I guess the situation is that
This means we have multiple options:
I would do option b) as it is more explicit about why we do thing differently. (I need to get back to your other comments above a bit later) |
Yes
we have to create new-cell in CreateNovaWith3CellsAndEnsureReady, because that's where the oher way would be to redefine all cells again, which is just a duplicate code of CreateNovaWith3CellsAndEnsureReady. |
20729e2 to
09ca074
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/b81fac0e1fef40fe95499e5f784d313c ✔️ openstack-meta-content-provider SUCCESS in 3h 22m 00s |
09ca074 to
bf2a470
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4b5237bf070745c18ac143e6d94bb68e ✔️ openstack-meta-content-provider SUCCESS in 2h 57m 35s |
|
/retest |
2 similar comments
|
/retest |
|
/retest |
bf2a470 to
89ca627
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/40aec968396741779ef7ecc17669ea60 ❌ openstack-meta-content-provider FAILURE in 10m 05s |
Right now when multiple cells gets deleted if any one the cell deletion fails, the control exits with error msg. This change stores the errors in a list and let next cells deleted. Adds a functional test Closes #OSPRH-10550
gibizer
left a comment
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.
I have couple of follow up requests but the current code and test looks good to me so lets land this and do the refactors in a separate PR
| "cell1": cell1Template, | ||
| "cell2": cell2Template, | ||
| "cell3": cell3Template, | ||
| } |
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.
As a followup try to de-duplicate logic in CreateNovaWith4CellsAndEnsureReady and CreateNovaWith3CellsAndEnsureReady via something like the following:
spec := GetDefaultNovaSpec()
spec["cellTemplates"] = map[string]interface{}{}
spec["cellTemplates"]["cell0"] = CreateCellTemplate("cell0")
spec["cellTemplates"]["cell1"] = CreateCellTemplate("cell1")
spec["cellTemplates"]["cell2"] = CreateCellTemplateWithoutCleanup("cell2")
spec["cellTemplates"]["cell3"] = CreateCellTemplateWithoutCleanup("cell3")
I guess the logic below the spec definition is hard to deduplicate that way because of ordering requirement of the simulation functions.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: auniyal61, gibizer, mrkisaolamb The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2e6d3cd
into
openstack-k8s-operators:main
Right now when multiple cells gets deleted if any one the cell deletion fails, the control exits with error msg.
This change stores the errors in a list and let next cells deleted.
Closes #OSPRH-10550