diff mbox series

[ovs-dev] ovs-save: Handle cases of upgrades from very old OVS versions.

Message ID 1557324716-13170-1-git-send-email-guru@ovn.org
State Accepted
Commit fe772f5395a61def37758318d910865f92268ae6
Headers show
Series [ovs-dev] ovs-save: Handle cases of upgrades from very old OVS versions. | expand

Commit Message

Gurucharan Shetty May 8, 2019, 2:11 p.m. UTC
We have added code to ovs-save over the last few releases
which makes the following bad assumptions.

1. The default OpenFlow version of running daemon is OpenFlow14.

Impact: This causes upgrades from older OVS versions to end up with no
flows in their bridges (even the default 'NORMAL' ones) causing traffic
to stop.

2. That ovs-ofctl commands like dump-groups and dump-tlv-map
will just work with old OVS versions.

Impact: Does not look like it effects the upgrade in a bad away - except
you get some errors.

Since OpenFlow14 was enabled by default in OVS 2.8, this commit makes
a lazy assumption that any upgrade of OVS from versions before 2.7
will not attempt to save and restore flows.

VMware-BZ: #2340482
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
---
 utilities/ovs-save | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Ben Pfaff May 9, 2019, 9:09 p.m. UTC | #1
On Wed, May 08, 2019 at 07:11:56AM -0700, Gurucharan Shetty wrote:
> We have added code to ovs-save over the last few releases
> which makes the following bad assumptions.
> 
> 1. The default OpenFlow version of running daemon is OpenFlow14.
> 
> Impact: This causes upgrades from older OVS versions to end up with no
> flows in their bridges (even the default 'NORMAL' ones) causing traffic
> to stop.
> 
> 2. That ovs-ofctl commands like dump-groups and dump-tlv-map
> will just work with old OVS versions.
> 
> Impact: Does not look like it effects the upgrade in a bad away - except
> you get some errors.
> 
> Since OpenFlow14 was enabled by default in OVS 2.8, this commit makes
> a lazy assumption that any upgrade of OVS from versions before 2.7
> will not attempt to save and restore flows.
> 
> VMware-BZ: #2340482
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> ---
>  utilities/ovs-save | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/utilities/ovs-save b/utilities/ovs-save
> index 1ba36e9..4df0c4a 100755
> --- a/utilities/ovs-save
> +++ b/utilities/ovs-save
> @@ -110,6 +110,15 @@ save_flows () {
>          exit 1
>      fi
>  
> +    case `ovs-appctl version | sed 1q` in
> +        "ovs-vswitchd (Open vSwitch) 1."*.*)
> +            return
> +            ;;
> +        "ovs-vswitchd (Open vSwitch) 2."[0-7].*)
> +            return
> +            ;;
> +    esac
> +

It took me a minute to figure out the logic here.

I recommend adding a comment, such as:
# OVS 2.7 and earlier do not enable OpenFlow 1.4 (by default) and lack
# other features needed to save and restore flows.  Don't try.

Acked-by: Ben Pfaff <blp@ovn.org>
Gurucharan Shetty May 9, 2019, 10:17 p.m. UTC | #2
On Thu, 9 May 2019 at 14:09, Ben Pfaff <blp@ovn.org> wrote:

> On Wed, May 08, 2019 at 07:11:56AM -0700, Gurucharan Shetty wrote:
> > We have added code to ovs-save over the last few releases
> > which makes the following bad assumptions.
> >
> > 1. The default OpenFlow version of running daemon is OpenFlow14.
> >
> > Impact: This causes upgrades from older OVS versions to end up with no
> > flows in their bridges (even the default 'NORMAL' ones) causing traffic
> > to stop.
> >
> > 2. That ovs-ofctl commands like dump-groups and dump-tlv-map
> > will just work with old OVS versions.
> >
> > Impact: Does not look like it effects the upgrade in a bad away - except
> > you get some errors.
> >
> > Since OpenFlow14 was enabled by default in OVS 2.8, this commit makes
> > a lazy assumption that any upgrade of OVS from versions before 2.7
> > will not attempt to save and restore flows.
> >
> > VMware-BZ: #2340482
> > Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> > ---
> >  utilities/ovs-save | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/utilities/ovs-save b/utilities/ovs-save
> > index 1ba36e9..4df0c4a 100755
> > --- a/utilities/ovs-save
> > +++ b/utilities/ovs-save
> > @@ -110,6 +110,15 @@ save_flows () {
> >          exit 1
> >      fi
> >
> > +    case `ovs-appctl version | sed 1q` in
> > +        "ovs-vswitchd (Open vSwitch) 1."*.*)
> > +            return
> > +            ;;
> > +        "ovs-vswitchd (Open vSwitch) 2."[0-7].*)
> > +            return
> > +            ;;
> > +    esac
> > +
>
> It took me a minute to figure out the logic here.
>
> I recommend adding a comment, such as:
> # OVS 2.7 and earlier do not enable OpenFlow 1.4 (by default) and lack
> # other features needed to save and restore flows.  Don't try.
>
> Acked-by: Ben Pfaff <blp@ovn.org>
>

Thanks, I added the suggested comment and pushed it to master, 2.11 and
2.10.
diff mbox series

Patch

diff --git a/utilities/ovs-save b/utilities/ovs-save
index 1ba36e9..4df0c4a 100755
--- a/utilities/ovs-save
+++ b/utilities/ovs-save
@@ -110,6 +110,15 @@  save_flows () {
         exit 1
     fi
 
+    case `ovs-appctl version | sed 1q` in
+        "ovs-vswitchd (Open vSwitch) 1."*.*)
+            return
+            ;;
+        "ovs-vswitchd (Open vSwitch) 2."[0-7].*)
+            return
+            ;;
+    esac
+
     workdir=$(mktemp -d "${TMPDIR:-/tmp}/ovs-save.XXXXXXXXXX")
     for bridge in "$@"; do
         # Get the highest enabled OpenFlow version