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

Sort cell-names in nova_controller #903

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ratailor
Copy link

@ratailor ratailor commented Nov 28, 2024

This change sorts the cell-names and also make sure that the cell0 is the first element in the orderedCellNames slice.

Closes: #OSPRH-9980

@openshift-ci openshift-ci bot requested review from jamepark4 and kk7ds November 28, 2024 12:31
Copy link
Contributor

openshift-ci bot commented Nov 28, 2024

Hi @ratailor. Thanks for your PR.

I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gibizer
Copy link
Contributor

gibizer commented Nov 28, 2024

How does the code on main leads to unstable condition messages? Could you please add that description to the PR's message?

@@ -309,12 +310,16 @@ func (r *NovaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resul
// iteration order is undefined we need to make sure that cell0 is the
// first to allow dependency handling during ensureCell calls.
orderedCellNames := []string{novav1.Cell0Name}
sortedCellNames := []string{}
Copy link
Contributor

Choose a reason for hiding this comment

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

we defintlly do not need to have 2 ordered lists of the same thing

if we were to do this, we shoudl not be keeping both the order cell name and sorted ones.

the entire point of orderedCellNames is to enforce a stable order.

Copy link
Author

Choose a reason for hiding this comment

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

Done

As of now, the orderedCellNames variable contains 'cell0' as first
element and then appends cell-names coming from CellTemplates map,
which doesn't provide stable ordering. Then the CR status condition
message could change for each reconcile with any change in the actual
status of the CR. And a changing status message could trigger
unnecessary reconcile loops.

This change sorts the cell-names and also make sure
that the cell0 is the first element in the orderedCellNames
slice to maintain stable ordering.

Closes: #OSPRH-9980
Copy link
Contributor

openshift-ci bot commented Dec 4, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ratailor
Once this PR has been reviewed and has the lgtm label, please ask for approval from seanmooney. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ratailor
Copy link
Author

ratailor commented Dec 4, 2024

How does the code on main leads to unstable condition messages? Could you please add that description to the PR's message?

Done

Comment on lines +316 to +317
// We need to sort the list of cellNames to iterate on to avoid
// unnecessary reconcile loop runs, as the map iteration order is undefined.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not for avoiding reconcile loops. It is for avoiding that different reconcile loops sees a different cell order while the cell creation is in the same state but generate a different condition message due to the different order.

@gibizer
Copy link
Contributor

gibizer commented Dec 20, 2024

I still would like to get a commit message / PR description that describes why we are doing this instead of / top of what the patch does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants