diff mbox series

[ovs-dev,2/3] ovn-controller: avoid monitoring wrong chassis

Message ID 20230718095331.2443200-3-xsimonar@redhat.com
State Accepted
Headers show
Series Unexpected warning "Trying to release unknown | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Xavier Simonart July 18, 2023, 9:53 a.m. UTC
To register a chassis to ovn-sb, ovn-controller create a "name-uuid"
for the chassis, which it will send to ovn-sb. In return, ovn-sb creates
the uuid based on that "name".
Using this "name-uuid" as a uuid in a monitor request to ovn-sb results in
monitoring a non-existing chassis.
The system returns on track as soon as ovn-controller receives the chassis
update from ovn-sb, as it will then send a new monitor request to ovn-sb,
with the proper chassis uuid.
However, if some ports were already in ovn-sb when it receives the monitor request
with the wrong uuid, ovn-sb will notify ovn-controller to delete all those ports.
This cause the following sequence in ovn-controller
- notification of a new port
- deletion of that port
- notification of a new port

We now prevent sending wrong uuid to ovn-sb.

This issue was causing test "testing load-balancer template IPv6" to fail
in a flaky way, due to the following warning:
if_status|WARN|Trying to release unknown interface vm2

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
---
 controller/chassis.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ales Musil July 19, 2023, 6:26 a.m. UTC | #1
On Tue, Jul 18, 2023 at 11:54 AM Xavier Simonart <xsimonar@redhat.com>
wrote:

> To register a chassis to ovn-sb, ovn-controller create a "name-uuid"
> for the chassis, which it will send to ovn-sb. In return, ovn-sb creates
> the uuid based on that "name".
> Using this "name-uuid" as a uuid in a monitor request to ovn-sb results in
> monitoring a non-existing chassis.
> The system returns on track as soon as ovn-controller receives the chassis
> update from ovn-sb, as it will then send a new monitor request to ovn-sb,
> with the proper chassis uuid.
> However, if some ports were already in ovn-sb when it receives the monitor
> request
> with the wrong uuid, ovn-sb will notify ovn-controller to delete all those
> ports.
> This cause the following sequence in ovn-controller
> - notification of a new port
> - deletion of that port
> - notification of a new port
>
> We now prevent sending wrong uuid to ovn-sb.
>
> This issue was causing test "testing load-balancer template IPv6" to fail
> in a flaky way, due to the following warning:
> if_status|WARN|Trying to release unknown interface vm2
>
> Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
> ---
>  controller/chassis.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/controller/chassis.c b/controller/chassis.c
> index ce88541ba..d3c944973 100644
> --- a/controller/chassis.c
> +++ b/controller/chassis.c
> @@ -831,7 +831,11 @@ chassis_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
>      }
>
>      ovs_chassis_cfg_destroy(&ovs_cfg);
> -    return chassis_rec;
> +    if (existed) {
> +        return chassis_rec;
> +    } else {
> +        return NULL;
> +    }
>  }
>
>  bool
> --
> 2.31.1
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Looks good to me, thanks!

Acked-by: Ales Musil <amusil@redhat.com>
Dumitru Ceara July 25, 2023, 3:23 p.m. UTC | #2
On 7/19/23 08:26, Ales Musil wrote:
> On Tue, Jul 18, 2023 at 11:54 AM Xavier Simonart <xsimonar@redhat.com>
> wrote:
> 
>> To register a chassis to ovn-sb, ovn-controller create a "name-uuid"
>> for the chassis, which it will send to ovn-sb. In return, ovn-sb creates
>> the uuid based on that "name".
>> Using this "name-uuid" as a uuid in a monitor request to ovn-sb results in
>> monitoring a non-existing chassis.
>> The system returns on track as soon as ovn-controller receives the chassis
>> update from ovn-sb, as it will then send a new monitor request to ovn-sb,
>> with the proper chassis uuid.
>> However, if some ports were already in ovn-sb when it receives the monitor
>> request
>> with the wrong uuid, ovn-sb will notify ovn-controller to delete all those
>> ports.
>> This cause the following sequence in ovn-controller
>> - notification of a new port
>> - deletion of that port
>> - notification of a new port
>>
>> We now prevent sending wrong uuid to ovn-sb.
>>
>> This issue was causing test "testing load-balancer template IPv6" to fail
>> in a flaky way, due to the following warning:
>> if_status|WARN|Trying to release unknown interface vm2
>>
>> Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
>> ---
>>  controller/chassis.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/controller/chassis.c b/controller/chassis.c
>> index ce88541ba..d3c944973 100644
>> --- a/controller/chassis.c
>> +++ b/controller/chassis.c
>> @@ -831,7 +831,11 @@ chassis_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
>>      }
>>
>>      ovs_chassis_cfg_destroy(&ovs_cfg);
>> -    return chassis_rec;
>> +    if (existed) {
>> +        return chassis_rec;
>> +    } else {
>> +        return NULL;
>> +    }

I changed this to the equivalent one-liner:

return existed ? chassis_rec : NULL;

I hope that's fine.

>>  }
>>
>>  bool
>> --
>> 2.31.1
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>>
> Looks good to me, thanks!
> 
> Acked-by: Ales Musil <amusil@redhat.com>
> 

I applied this to main and backported it to all branches down to 22.03.

Regards,
Dumitru
diff mbox series

Patch

diff --git a/controller/chassis.c b/controller/chassis.c
index ce88541ba..d3c944973 100644
--- a/controller/chassis.c
+++ b/controller/chassis.c
@@ -831,7 +831,11 @@  chassis_run(struct ovsdb_idl_txn *ovnsb_idl_txn,
     }
 
     ovs_chassis_cfg_destroy(&ovs_cfg);
-    return chassis_rec;
+    if (existed) {
+        return chassis_rec;
+    } else {
+        return NULL;
+    }
 }
 
 bool