Skip to content

Conversation

@bbezak
Copy link
Member

@bbezak bbezak commented Nov 6, 2025

After kolla-ansible patch [1] ovn commands can run on all nodes. Changing method of getting the leader.

[1] https://review.opendev.org/c/openstack/kolla-ansible/+/963412

error in previous method - multiple "leaders":

TASK [Assert one leader exists] ***************************************************************************************************************************************************************************************************
Tuesday 04 November 2025  20:19:54 +0000 (0:00:00.024)       0:00:06.813 ******
fatal: [HOST1]: FAILED! =>
    assertion: groups['ovn_nb_leader'] | default([]) | length == 1
    changed: false
    evaluated_to: false
    msg: 'Expected exactly 1 OVN NB leader, but found 4: [''''HOST1'', ''HOST2',
        ''HOST3'', ''HOST4'']'
fatal: [HOST2]: FAILED! =>
    assertion: groups['ovn_nb_leader'] | default([]) | length == 1
    changed: false
    evaluated_to: false
    msg: 'Expected exactly 1 OVN NB leader, but found 4: [''HOST1'', ''HOST2',
        ''HOST3'', ''HOST4''']'
fatal: [HOST3]: FAILED! =>
    assertion: groups['ovn_nb_leader'] | default([]) | length == 1
    changed: false
    evaluated_to: false
    msg: 'Expected exactly 1 OVN NB leader, but found 4: ['''HOST1'', ''HOST2',
        ''HOST3'', ''HOST4'']'
fatal: [HOST4]: FAILED! =>
    assertion: groups['ovn_nb_leader'] | default([]) | length == 1
    changed: false
    evaluated_to: false
    msg: 'Expected exactly 1 OVN NB leader, but found 4: [''HOST1'', ''HOST2',
        ''HOST3'', ''HOST4'']'

@bbezak bbezak requested a review from a team as a code owner November 6, 2025 10:42
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a bug in OVN leader detection within the chassis priority fix playbook. The previous method, which relied on the exit code of ovn-nbctl get-connection, became unreliable after a related change, leading to multiple nodes being identified as leaders. The fix replaces this with a more robust method using ovs-appctl cluster/status and checking the output for the node's role. This change is correct and effectively resolves the issue. I have one minor suggestion to improve the code's readability and maintainability.

jackhodgkiss
jackhodgkiss previously approved these changes Nov 6, 2025
jackhodgkiss
jackhodgkiss previously approved these changes Nov 6, 2025
After kolla-ansible patch [1] ovn commands can run on all nodes.
Changing method of getting the leader.

[1] https://review.opendev.org/c/openstack/kolla-ansible/+/963412

Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com>
@bbezak bbezak force-pushed the ovn-fix-chassis-priorities-fix-leader-check branch from 3d14a1d to 2e5720f Compare November 6, 2025 11:03
@bbezak bbezak merged commit f8f9b24 into stackhpc/2025.1 Nov 6, 2025
21 of 22 checks passed
@bbezak bbezak deleted the ovn-fix-chassis-priorities-fix-leader-check branch November 6, 2025 11:15
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.

4 participants