5f9769
From 15eefe928ea2a51c7ad03356821f0665ca6abb6d Mon Sep 17 00:00:00 2001
5f9769
From: Ilya Maximets <i.maximets@ovn.org>
5f9769
Date: Thu, 21 Jan 2021 20:23:27 +0100
5f9769
Subject: [PATCH] ovn-ctl: Add support for ovsdb-server
5f9769
 --disable-file-column-diff.
5f9769
5f9769
There is a change of a database file format in OVS version 2.15 that
5f9769
doesn't allow older versions of ovsdb-server to read the database file
5f9769
modified by the ovsdb-server version 2.15 or later.  This also affects
5f9769
runtime communications between servers in active-backup and cluster
5f9769
service models.
5f9769
5f9769
For the upgrade scenario OVS introduced special command line argument
5f9769
for ovsdb-server: --disable-file-column-diff.
5f9769
More datails in ovsdb(7) or here:
5f9769
  https://docs.openvswitch.org/en/latest/ref/ovsdb.7/#upgrading-from-version-2-14-and-earlier-to-2-15-and-later
5f9769
5f9769
In order to support upgrades of OVN databases introducing new option
5f9769
'--ovsdb-disable-file-column-diff' for ovn-ctl script that will pass
5f9769
aforementioned argument to ovsdb-server processes.
5f9769
5f9769
To simplify upgrades for users, ovn-ctl will add requested argument
5f9769
to ovsdb-server only if ovsdb-server actually supports it.
5f9769
5f9769
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
5f9769
Acked-by: Han Zhou <hzhou@ovn.org>
5f9769
Signed-off-by: Numan Siddique <numans@ovn.org>
5f9769
5f9769
(cherry-picked from upstream master commit 668b0d02aeff42d361bad36c2b247195c8d2c6f0)
5f9769
5f9769
Change-Id: Id5a70bd76f24f13ab0357f8e3c40159f77bc3141
5f9769
---
5f9769
 utilities/ovn-ctl | 12 ++++++++++++
5f9769
 1 file changed, 12 insertions(+)
5f9769
5f9769
diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl
5f9769
index c44201ccf..211c764a6 100755
5f9769
--- a/utilities/ovn-ctl
5f9769
+++ b/utilities/ovn-ctl
5f9769
@@ -251,6 +251,11 @@ $cluster_remote_port
5f9769
 
5f9769
     [ "$OVN_USER" != "" ] && set "$@" --user "$OVN_USER"
5f9769
 
5f9769
+    if test X"$OVSDB_DISABLE_FILE_COLUMN_DIFF" = Xyes; then
5f9769
+        (ovsdb-server --help | grep -q disable-file-column-diff) \
5f9769
+            && set "$@" --disable-file-column-diff
5f9769
+    fi
5f9769
+
5f9769
     if test X"$detach" != Xno; then
5f9769
         set "$@" --detach --monitor
5f9769
     else
5f9769
@@ -715,6 +720,8 @@ set_defaults () {
5f9769
     OVSDB_NB_WRAPPER=
5f9769
     OVSDB_SB_WRAPPER=
5f9769
 
5f9769
+    OVSDB_DISABLE_FILE_COLUMN_DIFF=no
5f9769
+
5f9769
     OVN_USER=
5f9769
 
5f9769
     OVN_CONTROLLER_LOG="-vconsole:emer -vsyslog:err -vfile:info"
5f9769
@@ -932,6 +939,11 @@ Options:
5f9769
   --ovs-user="user[:group]"      pass the --user flag to ovs daemons
5f9769
   --ovsdb-nb-wrapper=WRAPPER     run with a wrapper like valgrind for debugging
5f9769
   --ovsdb-sb-wrapper=WRAPPER     run with a wrapper like valgrind for debugging
5f9769
+  --ovsdb-disable-file-column-diff=no|yes
5f9769
+                                 Specifies whether or not ovsdb-server
5f9769
+                                 processes should be started with
5f9769
+                                 --disable-file-column-diff.
5f9769
+                                 More details in ovsdb(7).  (default: no)
5f9769
   -h, --help                     display this help message
5f9769
 
5f9769
 File location options:
5f9769
-- 
5f9769
2.29.2
5f9769