[ovs-dev] [PATCH] [PATCH ovn] ovn-nbctl: Monitor nb_cfg to detect and handle potential overflows

Mark Gray mark.d.gray at redhat.com
Fri Aug 20 16:53:47 UTC 2021


On 19/08/2021 16:28, Numan Siddique wrote:
> On Wed, Aug 18, 2021 at 8:44 PM <mheib at redhat.com> wrote:
>>
>> From: Mohammad Heib <mheib at redhat.com>
>>
>> ovn-nbctl sync command will increase nb_cfg value each time it is executed
>> with a specific wait_type, this increment will be handled without testing
>> the current nb_cfg value because it is not monitored and that could lead
>> to an overflow issue if nb_cfg == LLONG_MAX.
>>
>> To avoid such potential overflow cases we must monitor the real value
>> of nb_cfg each time sync is executed and if there is any overflow issue
>> it will be handled by function nbctl_pre_execute later on the execution.
>>
>> Fixes: be3a60f8e6a3 ("ovn-nbctl: Deal with nb_cfg overflows.")
>> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1979774
>> Signed-off-by: Mohammad Heib <mheib at redhat.com>
> 
> Thanks for the patch and fixing this issue.
> 
> Would you mind adding a test case in tests/ovn-nbctl.at to make sure
> that the nb_cfg value is wrapped when it is about to overflow.
> 

FYI: There seem to be some related tests in ovn-controller.at

ovn-controller - Bump Chassis_Private nb_cfg value
nb_cfg sync to OVS

> Thanks
> Numan
> 
>> ---
>>  utilities/ovn-nbctl.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
>> index ada53b662d3c..69be775bc567 100644
>> --- a/utilities/ovn-nbctl.c
>> +++ b/utilities/ovn-nbctl.c
>> @@ -830,6 +830,8 @@ static void
>>  nbctl_pre_sync(struct ctl_context *base OVS_UNUSED)
>>  {
>>      force_wait = true;
>> +    /* Monitor nb_cfg to detect and handle potential overflows. */
>> +    ovsdb_idl_add_column(base->idl, &nbrec_nb_global_col_nb_cfg);
>>  }
>>
>>  static void
>> --
>> 2.27.0
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> 



More information about the dev mailing list