[ovs-dev] [PATCH ovn] northd: fix lb_action when there are no active backends for lb health_check

Numan Siddique numans at ovn.org
Wed Nov 11 06:59:06 UTC 2020


On Wed, Nov 4, 2020 at 4:42 PM Flavio Fernandes <flavio at flaviof.com> wrote:
>
> Tested-by: Flavio Fernandes <flavio at flaviof.com <mailto:flavio at flaviof.com>>
>
>
> > On Nov 3, 2020, at 11:43 AM, Lorenzo Bianconi <lorenzo.bianconi at redhat.com> wrote:
> >
> > Fix the following warning reported by ovn-controller when there are no
> > active backends for lb health_check and selection_fields have been
> > configured for hash computation
> >
> > flow|WARN|error parsing actions "drop; hash_fields="ip_dst,ip_src,tcp_dst,tcp_src");":
> > Syntax error at `hash_fields' expecting end of input.
> >
> > Fixes: 5af304e747 ("Support selection fields in load balancer.")
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>

Hi Lorenzo,

Would you mind adding a  test case for this in ovn-northd.at ?
This would help in future regressions and adding the corresponding
code in northd-ddlog.

Thanks
Numan

> > ---
> > northd/ovn-northd.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
> > index 8800a3d3c..88d3e3ed2 100644
> > --- a/northd/ovn-northd.c
> > +++ b/northd/ovn-northd.c
> > @@ -3598,6 +3598,8 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip *lb_vip,
> >                                        struct ds *action,
> >                                        char *selection_fields)
> > {
> > +    bool skip_hash_fields = false;
> > +
> >     if (lb_vip->health_check) {
> >         ds_put_cstr(action, "ct_lb(backends=");
> >
> > @@ -3616,6 +3618,7 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip *lb_vip,
> >         }
> >
> >         if (!n_active_backends) {
> > +            skip_hash_fields = true;
> >             ds_clear(action);
> >             ds_put_cstr(action, "drop;");
> >         } else {
> > @@ -3626,7 +3629,7 @@ static void build_lb_vip_ct_lb_actions(struct lb_vip *lb_vip,
> >         ds_put_format(action, "ct_lb(backends=%s);", lb_vip->backend_ips);
> >     }
> >
> > -    if (selection_fields && selection_fields[0]) {
> > +    if (!skip_hash_fields && selection_fields && selection_fields[0]) {
> >         ds_chomp(action, ';');
> >         ds_chomp(action, ')');
> >         ds_put_format(action, "; hash_fields=\"%s\");", selection_fields);
> > --
> > 2.26.2
> >
> > _______________________________________________
> > 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