Re: [ovs-dev] [PATCH ovsdb v3 1/1] Add Local_Config schema

2022-06-30 Thread Ilya Maximets
On 6/28/22 17:27, Dumitru Ceara wrote:
> On 6/28/22 16:54, Terry Wilson wrote:
>> The only way to configure settings on a remote (e.g. inactivity_probe)
>> is via --remote=db:DB,table,row. There is no way to do this via the
>> existing CLI options.
>>
>> For a clustered DB with multiple servers listening on unique addresses
>> there is no way to store these entries in the DB as the DB is shared.
>> For example, three servers listening on  1.1.1.1, 1.1.1.2, and 1.1.1.3
>> respectively would require a Manager/Connection row each, but then
>> all three servers would try to listen on all three addresses.
>>
>> It is possible for ovsdb-server to serve multiple databases. This
>> means that we can have a local "config" database in addition to
>> the main database we are servering (Open_vSwitch, OVN_Southbound, etc.)
>> and this patch adds a Local_Config schema that currently just mirrors
>> the Connection table and a Config table with a 'connections' row that
>> stores each Connection.
>>
>> Signed-off-by: Terry Wilson 
>> ---
> 
> Looks good to me, thanks!
> 
> Acked-by: Dumitru Ceara 

Thanks, Terry and Dumitru!

There was a few issues with fedora and debian packaging, primarily
because the new schema file itself wasn't added to packages.
I fixed those and applied the patch.

Also applied to branch-2.17 taking into account that the change is
critical for OpenStack deployments with a clustered database model
and the fact that OVS 2.17 will be our new LTS.  The change itself
should also be a low risk, because it only adds a few files without
changing any functionality.

Best regards, Ilya Maximets.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovsdb v3 1/1] Add Local_Config schema

2022-06-28 Thread Dumitru Ceara
On 6/28/22 16:54, Terry Wilson wrote:
> The only way to configure settings on a remote (e.g. inactivity_probe)
> is via --remote=db:DB,table,row. There is no way to do this via the
> existing CLI options.
> 
> For a clustered DB with multiple servers listening on unique addresses
> there is no way to store these entries in the DB as the DB is shared.
> For example, three servers listening on  1.1.1.1, 1.1.1.2, and 1.1.1.3
> respectively would require a Manager/Connection row each, but then
> all three servers would try to listen on all three addresses.
> 
> It is possible for ovsdb-server to serve multiple databases. This
> means that we can have a local "config" database in addition to
> the main database we are servering (Open_vSwitch, OVN_Southbound, etc.)
> and this patch adds a Local_Config schema that currently just mirrors
> the Connection table and a Config table with a 'connections' row that
> stores each Connection.
> 
> Signed-off-by: Terry Wilson 
> ---

Looks good to me, thanks!

Acked-by: Dumitru Ceara 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovsdb v3 1/1] Add Local_Config schema

2022-06-28 Thread Terry Wilson
The only way to configure settings on a remote (e.g. inactivity_probe)
is via --remote=db:DB,table,row. There is no way to do this via the
existing CLI options.

For a clustered DB with multiple servers listening on unique addresses
there is no way to store these entries in the DB as the DB is shared.
For example, three servers listening on  1.1.1.1, 1.1.1.2, and 1.1.1.3
respectively would require a Manager/Connection row each, but then
all three servers would try to listen on all three addresses.

It is possible for ovsdb-server to serve multiple databases. This
means that we can have a local "config" database in addition to
the main database we are servering (Open_vSwitch, OVN_Southbound, etc.)
and this patch adds a Local_Config schema that currently just mirrors
the Connection table and a Config table with a 'connections' row that
stores each Connection.

Signed-off-by: Terry Wilson 
---
 NEWS   |   5 +
 debian/openvswitch-common.manpages |   1 +
 ovsdb/.gitignore   |   2 +
 ovsdb/automake.mk  |  21 ++
 ovsdb/local-config.ovsschema   |  43 +
 ovsdb/local-config.xml | 296 +
 rhel/openvswitch-fedora.spec.in|   1 +
 tests/ovsdb-cluster.at |  42 +++-
 8 files changed, 404 insertions(+), 7 deletions(-)
 create mode 100644 ovsdb/local-config.ovsschema
 create mode 100644 ovsdb/local-config.xml

diff --git a/NEWS b/NEWS
index 9fe3f44f4..b9e6f0216 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,11 @@ Post-v2.17.0
- DPDK:
  * OVS validated with DPDK 21.11.1.  It is recommended to use this version
until further releases.
+   - Local_Config schema added:
+ * Clustered ovsdb-servers listening on unique addresses can pass a second
+   DB created with the new Local_Config schema in order to configure their
+   Connections independent from each other. See the ovsdb.local-config.5
+   manpage for schema details.
 
 
 v2.17.0 - 17 Feb 2022
diff --git a/debian/openvswitch-common.manpages 
b/debian/openvswitch-common.manpages
index 95004122c..7c46a2acf 100644
--- a/debian/openvswitch-common.manpages
+++ b/debian/openvswitch-common.manpages
@@ -5,3 +5,4 @@ debian/tmp/usr/share/man/man8/ovs-appctl.8
 utilities/ovs-ofctl.8
 debian/tmp/usr/share/man/man8/ovs-parse-backtrace.8
 debian/tmp/usr/share/man/man8/ovs-pki.8
+ovsdb/ovsdb.local-config.5
diff --git a/ovsdb/.gitignore b/ovsdb/.gitignore
index fbcefafc6..a4f9d38f1 100644
--- a/ovsdb/.gitignore
+++ b/ovsdb/.gitignore
@@ -1,5 +1,7 @@
 /_server.ovsschema.inc
 /_server.ovsschema.stamp
+/local-config.ovsschema.stamp
+/ovsdb.local-config.5
 /ovsdb-client
 /ovsdb-client.1
 /ovsdb-doc
diff --git a/ovsdb/automake.mk b/ovsdb/automake.mk
index 62cc02686..3b3140102 100644
--- a/ovsdb/automake.mk
+++ b/ovsdb/automake.mk
@@ -148,4 +148,25 @@ ovsdb/ovsdb-server.5: \
$(srcdir)/ovsdb/_server.xml > $@.tmp && \
mv $@.tmp $@
 
+EXTRA_DIST += ovsdb/local-config.ovsschema
+pkgdata_DATA += ovsdb/local-config.ovsschema
+
+# Version checking for local-config.ovsschema.
+ALL_LOCAL += ovsdb/local-config.ovsschema.stamp
+ovsdb/local-config.ovsschema.stamp: ovsdb/local-config.ovsschema
+   $(srcdir)/build-aux/cksum-schema-check $? $@
+CLEANFILES += ovsdb/local-config.ovsschema.stamp
+
+# Local_Config schema documentation
+EXTRA_DIST += ovsdb/local-config.xml
+CLEANFILES += ovsdb/ovsdb.local-config.5
+man_MANS += ovsdb/ovsdb.local-config.5
+ovsdb/ovsdb.local-config.5: \
+   ovsdb/ovsdb-doc ovsdb/ ovsdb/local-config.xml 
ovsdb/local-config.ovsschema
+   $(AM_V_GEN)$(OVSDB_DOC) \
+   --version=$(VERSION) \
+   $(srcdir)/ovsdb/local-config.ovsschema \
+   $(srcdir)/ovsdb/local-config.xml > $@.tmp && \
+   mv $@.tmp $@
+
 EXTRA_DIST += ovsdb/TODO.rst
diff --git a/ovsdb/local-config.ovsschema b/ovsdb/local-config.ovsschema
new file mode 100644
index 0..bd86d0f4f
--- /dev/null
+++ b/ovsdb/local-config.ovsschema
@@ -0,0 +1,43 @@
+{
+"name": "Local_Config",
+"version": "1.0.0",
+"cksum": "2048726482 1858",
+"tables": {
+"Config": {
+"columns": {
+"connections": {
+"type": {"key": {"type": "uuid",
+ "refTable": "Connection"},
+ "min": 0,
+ "max": "unlimited"}}},
+"maxRows": 1,
+"isRoot": true},
+"Connection": {
+"columns": {
+"target": {"type": "string"},
+"max_backoff": {"type": {"key": {"type": "integer",
+ "minInteger": 1000},
+ "min": 0,
+ "max": 1}},
+"inactivity_probe": {"type": {"key": "integer",
+  "min": 0,
+