[ovs-dev] [PATCH] OVN: Enhance ovndb-servers.ocf to handle inactive_probe_interval updates

Numan Siddique nusiddiq at redhat.com
Fri Jun 28 18:17:13 UTC 2019


On Fri, Jun 28, 2019 at 11:46 PM Numan Siddique <nusiddiq at redhat.com> wrote:

>
>
> On Wed, Jun 26, 2019 at 2:42 PM <lmartins at redhat.com> wrote:
>
>> From: Lucas Alvares Gomes <lucasagomes at gmail.com>
>>
>> This patch is enhacing the ovndb-servers.ocf script to handle updates to
>> the inactive_probe_interval via pacemaker. For example, one could run:
>>
>> $ sudo crm_resource --resource ovndb_servers --set-parameter
>> inactive_probe_interval --parameter-value <new probe value>
>>
>> To set a new inactive probe interval in OVSDB. The patch also handles
>> the case were multiple connection exists.
>>
>> Signed-off-by: Lucas Alvares Gomes <lucasagomes at gmail.com>
>>
>
> Acked-by: Numan Siddique <nusiddiq at redhat.com>
>
>
Hi Lucas, there are few checkpatch warnings. You may want to fix those
errors
and submit v2.



>
>
>> ---
>>  ovn/utilities/ovndb-servers.ocf | 26 ++++++++++++++++++++++----
>>  1 file changed, 22 insertions(+), 4 deletions(-)
>>
>> diff --git a/ovn/utilities/ovndb-servers.ocf
>> b/ovn/utilities/ovndb-servers.ocf
>> index 10313304c..62ac53b7c 100755
>> --- a/ovn/utilities/ovndb-servers.ocf
>> +++ b/ovn/utilities/ovndb-servers.ocf
>> @@ -240,20 +240,38 @@ ovsdb_server_notify() {
>>          else
>>             LISTON_ON_IP=${MASTER_IP}
>>          fi
>> -        conn=`ovn-nbctl get NB_global . connections`
>> -        if [ "$conn" == "[]" ]
>> +        conn=`ovn-nbctl get NB_global . connections | awk -F'[][]'
>> '{print $2}'`
>> +        if [ -z "$conn" ]
>>          then
>>              ovn-nbctl -- --id=@conn_uuid create Connection \
>>  target="p${NB_MASTER_PROTO}\:${NB_MASTER_PORT}\:${LISTON_ON_IP}" \
>>  inactivity_probe=$INACTIVE_PROBE -- set NB_Global .
>> connections=@conn_uuid
>> +        else
>> +            for c in ${conn/, // }
>> +            do
>> +                iprob=`ovn-nbctl get Connection $c inactivity_probe`
>> +                if [ $iprob != $INACTIVE_PROBE ]
>> +                then
>> +                    ovn-nbctl set Connection $c
>> inactivity_probe=$INACTIVE_PROBE
>> +                fi
>> +            done
>>          fi
>>
>> -        conn=`ovn-sbctl get SB_global . connections`
>> -        if [ "$conn" == "[]" ]
>> +        conn=`ovn-sbctl get SB_global . connections | awk -F'[][]'
>> '{print $2}'`
>> +        if [ -z "$conn" ]
>>          then
>>              ovn-sbctl -- --id=@conn_uuid create Connection \
>>  target="p${SB_MASTER_PROTO}\:${SB_MASTER_PORT}\:${LISTON_ON_IP}" \
>>  inactivity_probe=$INACTIVE_PROBE -- set SB_Global .
>> connections=@conn_uuid
>> +        else
>> +            for c in ${conn/, // }
>> +            do
>> +                iprob=`ovn-sbctl get Connection $c inactivity_probe`
>> +                if [ $iprob != $INACTIVE_PROBE ]
>> +                then
>> +                    ovn-sbctl set Connection $c
>> inactivity_probe=$INACTIVE_PROBE
>> +                fi
>> +            done
>>          fi
>>
>>      else
>> --
>> 2.22.0
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>


More information about the dev mailing list