[ovs-dev] [PATCH v2] python: ovsdb-idl: Add custom transaction operations.

2024-04-15 Thread Terry Wilson
It can be useful to be able to send raw transaction operations through the Idl's connection. For example, to clean up MAC_Binding entries for floating IPs without having to monitor the MAC_Binding table which can be quite large. Signed-off-by: Terry Wilson --- NEWS | 2

Re: [ovs-dev] [PATCH 2/3] python: ovsdb-idl: Make IndexedRows mirror hmap.

2024-04-11 Thread Terry Wilson
w/o creating a race condition with multiple IDL clients. Terry On Wed, Apr 10, 2024 at 4:39 PM Terry Wilson wrote: > > The Python IDL code very closely mirrors the C IDL code, which uses > an hmap to store table rows. hmap code allows duplicate keys, while > IndexedRows, whi

[ovs-dev] [PATCH 3/3] python: ovsdb-idl: Convert new_uuid insert() arg to UUID.

2024-04-10 Thread Terry Wilson
Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 2 +- tests/test-ovsdb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index a80da84e7..0e201366b 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -1854,7 +1854,

[ovs-dev] [PATCH 2/3] python: ovsdb-idl: Make IndexedRows mirror hmap.

2024-04-10 Thread Terry Wilson
IndexedRows is modified to behave similarly to the C IDL's hmap implementation. Fixes: 55b9507e6824 ("ovsdb-idl: Add the support to specify the uuid for row insert.") Signed-off-by: Terry Wilson --- python/ovs/db/custom_index.py | 13 ++--- 1 file changed, 10 insertions(+), 3

[ovs-dev] [PATCH 1/3] ovsdb-idl: Add python keyword to persistent UUID test.

2024-04-10 Thread Terry Wilson
The Python persistent UUID tests should have the keyword "python" added so that TESTSUITEFLAGS="-k python" will not miss testing them. Fixes: 55b9507e6824 ("ovsdb-idl: Add the support to specify the uuid for row insert.") Signed-off-by: Terry Wilson --- tes

[ovs-dev] ovsdb-idl: potential issues with the persistent UUID implementation

2024-04-08 Thread Terry Wilson
There was a patch in OVS 3.1 that added support to the IDL code for specifying the permanent UUID of a row when inserting [1]. There are both C and Python implementations. Initially, I was adding support to ovsdbapp for this feature and noticed that the Python tests for this feature passed

Re: [ovs-dev] [PATCH 20/22] ovsdb-server: Allow user-provided config files.

2024-01-10 Thread Terry Wilson
On Mon, Jan 8, 2024 at 8:17 AM Ilya Maximets wrote: > > On 1/5/24 21:26, Terry Wilson wrote: > > On Wed, Dec 13, 2023 at 7:05 PM Ilya Maximets wrote: > > > >> -/* Clears and replaces 'remotes' and 'dbnames' by a configuration read > >> from > >

Re: [ovs-dev] [PATCH 20/22] ovsdb-server: Allow user-provided config files.

2024-01-05 Thread Terry Wilson
On Wed, Dec 13, 2023 at 7:05 PM Ilya Maximets wrote: > -/* Clears and replaces 'remotes' and 'dbnames' by a configuration read from > - * 'config_file', which must have been previously written by save_config(). > */ > -static void > +/* Clears and replaces 'remotes' and 'db_conf' by a

Re: [ovs-dev] [PATCH v2] python: idl: Handle monitor_canceled

2024-01-05 Thread Terry Wilson
On Fri, Jan 5, 2024 at 9:56 AM Simon Horman wrote: > > On Mon, Dec 18, 2023 at 05:31:24PM -0600, Terry Wilson wrote: > > Currently python-ovs claims to be "db change aware" but does not > > parse the "monitor_canceled" notification. Transactions can co

[ovs-dev] [PATCH v2] python: idl: Handle monitor_canceled

2023-12-18 Thread Terry Wilson
Currently python-ovs claims to be "db change aware" but does not parse the "monitor_canceled" notification. Transactions can continue being made, but the monitor updates will not be sent. This handles monitor_cancel similarly to how ovsdb-cs currently does. Signed-

[ovs-dev] [PATCH] python: idl: Handle monitor_canceled

2023-11-16 Thread Terry Wilson
solves this issue. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 4 1 file changed, 4 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 16ece0334..cfd81a1ec 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -481

Re: [ovs-dev] [OVN RFC 0/7] OVN IC bugfixes & proposals/questions

2023-11-16 Thread Terry Wilson
On Tue, Jan 24, 2023 at 8:00 AM Ilya Maximets wrote: > > On 1/24/23 14:12, Vladislav Odintsov wrote: > > Hi Ilya, > > > > could you please take a look on this? > > Maybe you can advice any direction how to investigate this issue? > > > > Thanks in advance. > > > > Regards, > > Vladislav Odintsov

[ovs-dev] [PATCH v5] python: Add async DNS support

2023-07-11 Thread Terry Wilson
to bring socket_util.py up to equivalency to the C version. Signed-off-by: Terry Wilson --- .github/workflows/build-and-test.yml| 4 +- Documentation/intro/install/general.rst | 4 +- Documentation/intro/install/rhel.rst| 2 +- Documentation/intro/install/windows.rst | 2 +- NEWS

[ovs-dev] [PATCH v4] python: Add async DNS support

2023-07-11 Thread Terry Wilson
to bring socket_util.py up to equivalency to the C version. Signed-off-by: Terry Wilson --- .github/workflows/build-and-test.yml| 4 +- Documentation/intro/install/general.rst | 4 +- Documentation/intro/install/rhel.rst| 2 +- Documentation/intro/install/windows.rst | 2 +- NEWS

Re: [ovs-dev] [PATCH v3] python: Add async DNS support

2023-07-10 Thread Terry Wilson
On Mon, Jul 10, 2023 at 10:32 AM Terry Wilson wrote: > > I accidentally forgot to click reply-to-all. > > On Fri, Jun 30, 2023 at 10:27 AM Ilya Maximets wrote: > > > > On 6/30/23 16:54, Adrian Moreno wrote: > > > > > > > > > On 6/30/23 14:35, I

Re: [ovs-dev] [PATCH v3] python: Add async DNS support

2023-07-10 Thread Terry Wilson
>>> > >>> On 6/30/23 13:40, Ilya Maximets wrote: > >>>> On 6/30/23 12:39, Adrian Moreno wrote: > >>>>> > >>>>> > >>>>> On 6/14/23 23:07, Terry Wilson wrote: > >>>>>> This adds a Python versio

Re: [ovs-dev] Scale testing OVN with ovn-heater for OpenStack use cases

2023-06-30 Thread Terry Wilson
On Fri, Jun 30, 2023 at 2:26 AM Frode Nordahl wrote: > > Hello all, > > On Tue, May 30, 2023 at 5:16 PM Felix Huettner > wrote: > > > > Hi Dumitru, > > > > On Fri, May 26, 2023 at 01:30:54PM +0200, Dumitru Ceara wrote: > > > On 5/24/23 09:37, Felix Huettner wrote: > > > > Hi everyone, > > > > >

Re: [ovs-dev] [PATCH v3] python: Add async DNS support

2023-06-27 Thread Terry Wilson
On Fri, Jun 23, 2023 at 11:20 AM Ilya Maximets wrote: > > On 6/23/23 17:15, Terry Wilson wrote: > > Just checking in on this. I see a single test failure > > https://github.com/ovsrobot/ovs/actions/runs/5272193494 'linux clang > > test asan' but it looks like some

Re: [ovs-dev] [PATCH v3] python: Add async DNS support

2023-06-23 Thread Terry Wilson
Just checking in on this. I see a single test failure https://github.com/ovsrobot/ovs/actions/runs/5272193494 'linux clang test asan' but it looks like something related to bfd, so definitely not the python patch here. Anything I need to do? On Wed, Jun 14, 2023 at 4:07 PM Terry Wilson wrote

[ovs-dev] [PATCH v3] python: Add async DNS support

2023-06-14 Thread Terry Wilson
to bring socket_util.py up to equivalency to the C version. Signed-off-by: Terry Wilson --- .github/workflows/build-and-test.yml| 4 +- Documentation/intro/install/general.rst | 4 +- Documentation/intro/install/rhel.rst| 2 +- Documentation/intro/install/windows.rst | 2 +- NEWS

[ovs-dev] [PATCH v2] python: Add aync DNS support

2023-05-17 Thread Terry Wilson
to bring socket_util.py up to equivalency to the C version. Signed-off-by: Terry Wilson --- .github/workflows/build-and-test.yml | 4 +- debian/control.in| 1 + python/TODO.rst | 7 + python/automake.mk | 2 + python/ovs

Re: [ovs-dev] [PATCH] python: Add aync DNS support

2023-05-16 Thread Terry Wilson
Signed-off-by: Terry Wilson I can re-send if needed for the sign-off. I've tried to list the caveats in the commit message/TODO entry. Before I got too far into digging around into the socket_util and jsonrpc/reconnect code, I figured I'd put this out there to see if any major changes needed

[ovs-dev] [PATCH] python: Add aync DNS support

2023-05-16 Thread Terry Wilson
This adds a Python version of the async DNS support added in: 771680d96 DNS: Add basic support for asynchronous DNS resolving The above version uses the unbound C library, and this implimentation uses the SWIG-wrapped Python version of that. In the event that the Python unbound library is not

Re: [ovs-dev] [PATCH v8] ovsdb-idl: Add the support to specify the uuid for row insert.

2022-11-28 Thread Terry Wilson
print_and_log("%03d: change conditions", step++); > } else if (arg[0] != '[') { > -idl_set(idl, arg, step++); > +if (!idl_set(idl, arg, step++)) { > +/* If idl_set() returns false, then no transaction > +

[ovs-dev] [PATCH ovsdb v1] Add CLI remote confiuration parity with DB

2022-07-22 Thread Terry Wilson
Several remote config options are configurable via the DB, e.g. inactivity_probe and max_backoff. This patch adds the ability to configure these options via the CLI as well, e.g.: --remote="pssl:6640;inactivity_probe=1,max_backoff=4000" Signed-off-by: Terry Wilson --- ovsdb/ov

[ovs-dev] [PATCH v4 ovsdb 1/1] Add ovs-confctl utility for Local_Config db

2022-07-12 Thread Terry Wilson
This adds ovs-confctl to configure DBs running the Local_Config schema added in 6f24c2bc7. Signed-off-by: Terry Wilson --- debian/openvswitch-common.install | 1 + debian/openvswitch-common.manpages | 1 + lib/.gitignore | 3 + lib/automake.mk| 8

[ovs-dev] [PATCH v3 ovsdb 1/1] Add ovs-confctl utility for Local_Config db

2022-07-12 Thread Terry Wilson
This adds ovs-confctl to configure DBs running the Local_Config schema added in 6f24c2bc7. Signed-off-by: Terry Wilson --- debian/openvswitch-common.install | 1 + debian/openvswitch-common.manpages | 1 + lib/.gitignore | 3 + lib/automake.mk| 8

[ovs-dev] [PATCH v2 ovsdb 1/1] Add ovs-confctl utility for Local_Config db

2022-07-12 Thread Terry Wilson
This adds ovs-confctl to configure DBs running the Local_Config schema added in 6f24c2bc7. Signed-off-by: Terry Wilson --- debian/openvswitch-common.install | 1 + debian/openvswitch-common.manpages | 1 + lib/.gitignore | 3 + lib/automake.mk| 8

[ovs-dev] [PATCH ovsdb 1/1] Add ovs-confctl utility for Local_Config db

2022-07-12 Thread Terry Wilson
This adds ovs-confctl to configure DBs running the Local_Config schema added in 6f24c2bc7. Signed-off-by: Terry Wilson --- debian/openvswitch-common.install | 1 + debian/openvswitch-common.manpages | 1 + lib/.gitignore | 3 + lib/automake.mk| 8

Re: [ovs-dev] [PATCH ovn v3 1/1] Allow arbitrary args to be passed to called binary

2022-06-29 Thread Terry Wilson
On Wed, Jun 29, 2022 at 2:40 AM Dumitru Ceara wrote: > > On 6/28/22 17:22, Terry Wilson wrote: > > On Tue, Jun 28, 2022 at 4:39 AM Dumitru Ceara wrote: > >> > >> On 6/27/22 18:00, Terry Wilson wrote: > >>> It is common to pass ovn-ctl options via an /et

Re: [ovs-dev] [PATCH ovn v3 1/1] Allow arbitrary args to be passed to called binary

2022-06-28 Thread Terry Wilson
On Tue, Jun 28, 2022 at 4:39 AM Dumitru Ceara wrote: > > On 6/27/22 18:00, Terry Wilson wrote: > > It is common to pass ovn-ctl options via an /etc/sysconfig file. > > It would be useful to be able to pass custom --remote options or > > additional DBs to listen to via th

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

2022-06-28 Thread Terry Wilson
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: Te

[ovs-dev] [PATCH ovn v3 1/1] Allow arbitrary args to be passed to called binary

2022-06-27 Thread Terry Wilson
-by: Terry Wilson --- utilities/ovn-ctl | 22 ++ utilities/ovn-ctl.8.xml | 14 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 23d4d7f8c..93be9b84b 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl

Re: [ovs-dev] [PATCH] python: Add Python bindings TODO file.

2022-06-27 Thread Terry Wilson
cbb06ae 100644 > --- a/python/automake.mk > +++ b/python/automake.mk > @@ -117,3 +117,5 @@ $(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template > mv $@.tmp $@ > EXTRA_DIST += python/ovs/dirs.py.template > CLEANFILES += pyt

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

2022-06-27 Thread Terry Wilson
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: Te

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

2022-06-24 Thread Terry Wilson
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: Te

[ovs-dev] [PATCH ovn v2 1/1] Allow arbitrary args to be passed to called binary

2022-06-23 Thread Terry Wilson
-by: Terry Wilson --- utilities/ovn-ctl | 22 ++ utilities/ovn-ctl.8.xml | 10 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 23d4d7f8c..93be9b84b 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl

[ovs-dev] [PATCH ovn 1/1] Allow arbitrary args to be passed to called binary

2022-06-23 Thread Terry Wilson
-by: Terry Wilson --- utilities/ovn-ctl | 22 ++ utilities/ovn-ctl.8.xml | 10 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl index 23d4d7f8c..955ddd9a3 100755 --- a/utilities/ovn-ctl +++ b/utilities/ovn-ctl

[ovs-dev] [PATCH v5 ovn 2/2] Ensure pid belongs to ovsdb-server in ovn-ctl

2022-06-08 Thread Terry Wilson
When checking if ovsdb-server is running, ensure that the binary we are going to run matches the one actually running with the the pid that was in our pidfile. Signed-off-by: Terry Wilson --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl

[ovs-dev] [PATCH v5 ovn 1/2] Handle re-used pids in pidfile_is_running

2022-06-08 Thread Terry Wilson
Since pids can be re-used, it is necessary to check that the process that is running with a pid matches the one that we expect. This adds the ability to optionally pass a 'binary' argument to pidfile_is_running, and if it is passed to match the binary against /proc/$pid/exe. Signed-off-by: Terry

[ovs-dev] [PATCH v4 2/2] Ensure pid belongs to ovsdb-server in ovn-ctl

2022-06-07 Thread Terry Wilson
When checking if ovsdb-server is running, ensure that the binary we are going to run matches the one actually running with the the pid that was in our pidfile. Signed-off-by: Terry Wilson --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl

[ovs-dev] [PATCH v4 1/2] Handle re-used pids in pidfile_is_running

2022-06-07 Thread Terry Wilson
Since pids can be re-used, it is necessary to check that the process that is running with a pid matches the one that we expect. This adds the ability to optionally pass a 'binary' argument to pidfile_is_running, and if it is passed to match the binary against /proc/$pid/exe. Signed-off-by: Terry

[ovs-dev] [PATCH v3 1/2] Handle re-used pids in pidfile_is_running

2022-06-07 Thread Terry Wilson
Since pids can be re-used, it is necessary to check that the process that is running with a pid matches the one that we expect. This adds the ability to optionally pass a 'binary' argument to pidfile_is_running, and if it is passed to match the binary against /proc/$pid/exe. Signed-off-by: Terry

[ovs-dev] [PATCH v3 2/2] Ensure pid belongs to ovsdb-server in ovn-ctl

2022-06-07 Thread Terry Wilson
When checking if ovsdb-server is running, ensure that the binary we are going to run matches the one actually running with the the pid that was in our pidfile. Signed-off-by: Terry Wilson --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl

[ovs-dev] [PATCH v2 ovn 1/2] Handle re-used pids in pidfile_is_running

2022-06-02 Thread Terry Wilson
Since pids can be re-used, it is necessary to check that the process that is running with a pid matches the one that we expect. This adds the ability to optionally pass a 'binary' argument to pidfile_is_running, and if it is passed to match the binary against /proc/$pid/exe. Signed-off-by: Terry

[ovs-dev] [PATCH v2 ovn 2/2] Ensure pid belongs to ovsdb-server in ovn-ctl

2022-06-02 Thread Terry Wilson
When checking if ovsdb-server is running, ensure that the binary we are going to run matches the one actually running with the the pid that was in our pidfile. Signed-off-by: Terry Wilson --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl

Re: [ovs-dev] [PATCH ovn 1/2] Handle re-used pids in pidfile_is_running

2022-06-02 Thread Terry Wilson
On Wed, Jun 1, 2022 at 10:18 PM Ihar Hrachyshka wrote: > > On Wed, Jun 1, 2022 at 1:26 PM Terry Wilson wrote: > > > > Since pids can be re-used, it is necessary to check that the > > process that is running with a pid matches the one that we expect. > > > >

Re: [ovs-dev] [PATCH ovn 1/2] Handle re-used pids in pidfile_is_running

2022-06-01 Thread Terry Wilson
On Wed, Jun 1, 2022 at 1:30 PM 0-day Robot wrote: > checkpatch: > WARNING: Line is 124 characters long (recommended limit is 79) > #44 FILE: utilities/ovn-ctl:52: > test -e "$pidfile" && [ -s "$pidfile" ] && pid=`cat "$pidfile"` && > pid_exists "$pid" && pid_exe_matches "$pid" "$binary" > >

[ovs-dev] [PATCH ovn 1/2] Handle re-used pids in pidfile_is_running

2022-06-01 Thread Terry Wilson
Since pids can be re-used, it is necessary to check that the process that is running with a pid matches the one that we expect. This adds the ability to optionally pass a 'binary' argument to pidfile_is_running, and if it is passed to match the binary against /proc/$pid/exe. Signed-off-by: Terry

[ovs-dev] [PATCH ovn 2/2] Ensure pid belongs to ovsdb-server in ovn-ctl

2022-06-01 Thread Terry Wilson
When checking if ovsdb-server is running, ensure that the binary we are going to run matches the one actually running with the the pid that was in our pidfile. Signed-off-by: Terry Wilson --- utilities/ovn-ctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-ctl

[ovs-dev] [PATCH ovn 0/2] Add check for for process in pidfile_is_running

2022-06-01 Thread Terry Wilson
the ability to add an optional process name check to avoid this situation. Terry Wilson (2): Handle re-used pids in pidfile_is_running Ensure pid belongs to ovsdb-server in ovn-ctl ovs | 2 +- utilities/ovn-ctl | 11 +-- 2 files changed, 10 insertions(+), 3 deletions

Re: [ovs-dev] [PATCH v3 01/18] python: add generic Key-Value parser

2022-05-02 Thread Terry Wilson
LGTM Acked-by: Terry Wilson On Fri, Mar 11, 2022 at 9:22 AM Adrian Moreno wrote: > > Most of ofproto and dpif flows are based on key-value pairs. These > key-value pairs can be represented in several ways, eg: key:value, > key=value, key(value). > > Add the following classes

[ovs-dev] [PATCH] python: Raise AttributeError from uuid_to_row

2022-05-02 Thread Terry Wilson
, which is not expected from a getattr() or hasattr() call, which could break existing code. Fixes: 4e3966e64 (python: Politely handle misuse of table.condition.) Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python

Re: [ovs-dev] [PATCH] python: Raise AttributeError from uuid_to_row

2022-04-30 Thread Terry Wilson
On Sat, Apr 30, 2022 at 3:10 PM Terry Wilson wrote: > > Prior to 4e3966e64, when calling _uuid_to_row, it would raise an > AttributeError when trying to access base.ref_table.rows if the > referenced table was not registered. When called from > Row.__getattr__(), this would appr

[ovs-dev] [PATCH] python: Raise AttributeError from uuid_to_row

2022-04-30 Thread Terry Wilson
, which is not expected from a getattr() or hasattr() call, which could break existing code. Fixes: 4e3966e64 (python: Politely handle misuse of table.condition.) Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python

[ovs-dev] [PATCH v4] python: Politely handle misuse of table.condition

2022-04-13 Thread Terry Wilson
. Fixes: 46d44cf3b ("python: idl: Add monitor_cond_since support") Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 102 --- 1 file changed, 67 insertions(+), 35 deletions(-) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index

Re: [ovs-dev] [PATCH v3] python: Politely handle misuse of table.condition

2022-04-13 Thread Terry Wilson
On Wed, Apr 13, 2022 at 3:06 AM Dumitru Ceara wrote: > > On 4/12/22 21:52, Terry Wilson wrote: > > Before 46d44cf3b, it was technically possible to assign a monitor > > condition directly to Idl.tables[table_name].condition. If done > > before the connection was establishe

[ovs-dev] [PATCH v3] python: Politely handle misuse of table.condition

2022-04-12 Thread Terry Wilson
interface. Row._uuid_to_row is added to allow looking up ref_table rows. Fixes: 46d44cf3b ("python: idl: Add monitor_cond_since support") Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 95 +++- 1 file changed, 67 insertions(+), 28 deletion

Re: [ovs-dev] [PATCH] Politely handle misuse of table.condition

2022-04-12 Thread Terry Wilson
On Tue, Apr 12, 2022 at 3:25 AM Dumitru Ceara wrote: > > cc: ovs-dev (it got dropped by accident) > > On 4/12/22 00:07, Terry Wilson wrote: > > On Fri, Apr 1, 2022 at 9:02 AM Dumitru Ceara wrote: > >> > >> On 3/25/22 18:37, Terry Wilson wrote: > >>&g

[ovs-dev] [PATCH v2] python: Politely handle misuse of table.condition

2022-04-11 Thread Terry Wilson
: Add monitor_cond_since support") Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 18 ++ 1 file changed, 18 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 83a634dd0..1f75e9d8e 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -140

[ovs-dev] [PATCH] Politely handle misuse of table.condition

2022-03-25 Thread Terry Wilson
a connection is established). Fixes: 46d44cf3b ("python: idl: Add monitor_cond_since support") Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 17 + 1 file changed, 17 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 4ecdcaa19..b67504

Re: [ovs-dev] [PATCH 1/3] python: idl: Resend requested but not acked conditions when reconnecting.

2022-01-18 Thread Terry Wilson
._req_cond = (self._req_cond, None) > +if self._req_cond is not None: > +if self._new_cond is None: > + self._new_cond = self._req_cond > +self._req_cond = None > > > class Idl(object): > Acked-By: Terry Wilson ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Re: [ovs-dev] [PATCH 1/1] python: Add cooperative_yield() API method to Idl.

2021-12-03 Thread Terry Wilson
Thanks! I'll try that. On Thu, Dec 2, 2021 at 3:27 PM Mike Pattrick wrote: > > Hello Terry, > > On Thu, Dec 2, 2021 at 3:52 PM Terry Wilson wrote: > > > > On Thu, Dec 2, 2021 at 2:38 PM 0-day Robot wrote: > > > > > > Bleep bloop. Greetings Terry

[ovs-dev] [PATCH branch-2.15 1/1] python: Add cooperative_yield() API method to Idl

2021-12-03 Thread Terry Wilson
that defaults to doing nothing, but can be overridden to yield as needed. Signed-off-by: Terry Wilson (cherry picked from commit d28c5ca57650d6866453d0adb9a2e048cda21a86) --- NEWS | 6 ++ python/ovs/db/idl.py | 11 +++ 2 files changed, 17 insertions(+) diff --git

Re: [ovs-dev] [PATCH v5] python: Add monitor_cond_since support

2021-12-03 Thread Terry Wilson
On Fri, Dec 3, 2021 at 6:06 AM Dumitru Ceara wrote: > > On 12/1/21 18:51, Terry Wilson wrote: > > Add support for monitor_cond_since / update3 to python-ovs to > > allow more efficient reconnections when connecting to clustered > > OVSDB servers. > > &

Re: [ovs-dev] [PATCH 1/1] python: Add cooperative_yield() API method to Idl.

2021-12-02 Thread Terry Wilson
On Thu, Dec 2, 2021 at 2:38 PM 0-day Robot wrote: > > Bleep bloop. Greetings Terry Wilson, I am a robot and I have tried out your > patch. > Thanks for your contribution. > > I encountered some error that I wasn't expecting. See the details below. > > > git-a

[ovs-dev] [PATCH 1/1] python: Add cooperative_yield() API method to Idl.

2021-12-02 Thread Terry Wilson
that defaults to doing nothing, but can be overridden to yield as needed. Signed-off-by: Terry Wilson (cherry picked from commit d28c5ca57650d6866453d0adb9a2e048cda21a86) --- NEWS | 6 ++ python/ovs/db/idl.py | 11 +++ 2 files changed, 17 insertions(+) diff --git

[ovs-dev] [PATCH 0/1] python: Backport cooperative_yield addition

2021-12-02 Thread Terry Wilson
excpet the NEWS file. Terry Wilson (1): python: Add cooperative_yield() API method to Idl. NEWS | 6 ++ python/ovs/db/idl.py | 11 +++ 2 files changed, 17 insertions(+) -- 2.31.1 ___ dev mailing list d...@openvswitch.org

[ovs-dev] [PATCH v5] python: Add monitor_cond_since support

2021-12-01 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 245 --- tests/ovsdb-idl.at | 2 +- 2 files changed

[ovs-dev] [PATCH v4] python: Add monitor_cond_since support

2021-12-01 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 245 --- tests/ovsdb-idl.at | 2 +- 2 files changed

Re: [ovs-dev] [PATCH v3] Add monitor_cond_since support

2021-12-01 Thread Terry Wilson
On Fri, Nov 26, 2021 at 5:38 AM Dumitru Ceara wrote: > Nit: To be consistent with the other ifs below we should probably add > this comment: > > # Database contents changed. Will do. > > +# If 'found' is false, clear table rows for new > > dump > > +

[ovs-dev] [PATCH v3] Add monitor_cond_since support

2021-11-20 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 231 --- tests/ovsdb-idl.at | 2 +- 2 files changed

[ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-11-05 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..13477a6a9 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

[ovs-dev] [PATCH v2] python: idl: Avoid pre-allocating column defaults

2021-11-05 Thread Terry Wilson
' fields set, this saves around 300MB of memory. One could argue that if values are not going to change from their defaults, then users should not be monitoring those columns, but it's also probably good to not waste memory even if user code is sub-optimal. Signed-off-by: Terry Wilson --- python

Re: [ovs-dev] [PATCH] [python] Avoid pre-allocating column defaults

2021-11-05 Thread Terry Wilson
Thanks for the review! On Fri, Nov 5, 2021 at 5:43 AM Dumitru Ceara wrote: > > Hi Terry, > > Nit: I'd prefix the commit subject line with "python: idl: ". > > On 10/12/21 9:53 PM, Terry Wilson wrote: > > Many python implementations pre-allocate space for m

Re: [ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-11-05 Thread Terry Wilson
On Fri, Nov 5, 2021 at 6:07 AM Dumitru Ceara wrote: > > On 10/20/21 10:56 PM, Terry Wilson wrote: > > ovsdb-tool join-cluster requires a remote addr, so the existing > > code that tried to join a cluster without it when there was an > > existing $DB_FILE would fail

Re: [ovs-dev] [PATCH v2] [python] Add monitor_cond_since support

2021-11-04 Thread Terry Wilson
On Wed, Nov 3, 2021, 11:22 AM Ilya Maximets wrote: > On 11/3/21 01:36, Terry Wilson wrote: > > Add support for monitor_cond_since / update3 to python-ovs to > > allow more efficient reconnections when connecting to clustered > > OVSDB servers. > > >

[ovs-dev] [PATCH v2] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 55 +++- 1 file changed, 44 insertions(+), 11 deletions

[ovs-dev] [PATCH] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
Add support for monitor_cond_since / update3 to python-ovs to allow more efficient reconnections when connecting to clustered OVSDB servers. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 60 ++-- 1 file changed, 47 insertions(+), 13 deletions

[ovs-dev] [PATCH 0/1] [python] Add monitor_cond_since support

2021-11-02 Thread Terry Wilson
I added monitor_cond_since / update3 support to the python IDL. I think ultimately it would be good to refactor a lot of the code to be a little more ovsdb_cs-like, but I'd rather come back and do that without also adding features. Terry Wilson (1): [python] Add monitor_cond_since support

Re: [ovs-dev] [PATCH v4 2/2] python: replace pyOpenSSL with ssl

2021-11-01 Thread Terry Wilson
Acked-by: Terry Wilson Tested-by: Terry Wilson On Fri, Oct 29, 2021 at 6:12 PM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, > https://issues.redhat.com/browse/CS-336), b

Re: [ovs-dev] [PATCH v3 2/2] python: replace pyOpenSSL with ssl

2021-10-27 Thread Terry Wilson
On Mon, Oct 25, 2021 at 8:46 AM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, > https://issues.redhat.com/browse/CS-336), but since OVS only > supports Python 3 it's possible to replace

Re: [ovs-dev] [PATCH v3 1/2] socket-util: split inet_open_active function and use connect_ex

2021-10-27 Thread Terry Wilson
dress) > +if sock is None: > +return family, sock > +error = inet_connect_active(sock, address, family, dscp) > +if error: > +return error, None > +return 0, sock > > > def get_exception_errno(e): > -- > 2.31.1 > Tested against neutron "OverSsl" tests, and everything worked as it should. Acked-by: Terry Wilson Tested-by: Terry Wilson ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

[ovs-dev] [PATCH v2] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..a710f053a 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

Re: [ovs-dev] [PATCH] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
On Wed, Oct 20, 2021 at 2:45 PM Terry Wilson wrote: > > ovsdb-tool join-cluster requires a remote addr, so the existing > code that tried to join a cluster without it when there was an > existing $DB_FILE would fail. > > Instead, if we are trying to specifica

[ovs-dev] [PATCH] Backup and remove existing DB when joining cluster

2021-10-20 Thread Terry Wilson
continuing to join the cluster. Signed-off-by: Terry Wilson --- utilities/ovs-lib.in | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in index 3eda01d3c..06f4319d5 100644 --- a/utilities/ovs-lib.in +++ b/utilities/ovs-lib.in

[ovs-dev] [PATCH] [python] Allow custom transaction ops to be added

2021-10-13 Thread Terry Wilson
It can be useful to be able to send raw transaction operations through the Idl's connection. For example, to clean up MAC_Binding entries for floating IPs without having to monitor the MAC_Binding table which can be quite large. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 18

Re: [ovs-dev] [PATCH v2] python: replace pyOpenSSL with ssl

2021-10-13 Thread Terry Wilson
try: > -self.socket.shutdown() > -except SSL.Error: > + self.socket.shutdown(socket.SHUT_RDWR) > +except (socket.error, OSError, ValueError): > pass > return super(SSLStream, self).close() > > > -if SSL: > +if ssl: > # Register SSL only if the OpenSSL module is available > Stream.register_method("ssl", SSLStream) > diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at > index 501c13b81..0f229b2f9 100644 > --- a/tests/ovsdb-idl.at > +++ b/tests/ovsdb-idl.at > @@ -225,7 +225,7 @@ m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY], > m4_define([OVSDB_CHECK_IDL_SSL_PY], >[AT_SETUP([$1 - Python3 - SSL]) > AT_SKIP_IF([test "$HAVE_OPENSSL" = no]) > - $PYTHON3 -c "import OpenSSL.SSL" > + $PYTHON3 -c "import ssl" > SSL_PRESENT=$? > AT_SKIP_IF([test $SSL_PRESENT != 0]) > AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5]) > -- > 2.31.1 > I tested with the neutron ml2/ovn tests that run over SSL and everything behaved the same. Nice work--what a pain! Acked-by: Terry Wilson Tested-by: Terry Wilson ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Re: [ovs-dev] [PATCH branch-2.14] python: idl: Avoid sending transactions when the DB is not synced up.

2021-10-13 Thread Terry Wilson
On Wed, Oct 13, 2021 at 11:13 AM Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > Until now the code here would happily try to send transactions to the > database server even if the database connection was not in the correct > state. In som

[ovs-dev] [PATCH branch-2.14] python: idl: Avoid sending transactions when the DB is not synced up.

2021-10-13 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson (cherry picked from commit 34fbdc41084c16f855efa9c56086b03644408b7d) --- python/ovs/db/idl.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py

[ovs-dev] [PATCH] [python] Avoid pre-allocating column defaults

2021-10-12 Thread Terry Wilson
' fields set, this saves around 300MB of memory. One could argue that if values are not going to change from their defaults, then users should not be monitoring those columns, but it's also probably good to not waste memory even if user code is sub-optimal. Signed-off-by: Terry Wilson --- python

[ovs-dev] [PATCH] [python] Avoid alloc of an attr dict/row+column

2021-10-12 Thread Terry Wilson
be millions of rows in a database, avoiding this allocation with __slots__ can save 100s of MBs of memory per Idl process. Signed-off-by: Terry Wilson --- python/ovs/db/data.py | 4 1 file changed, 4 insertions(+) diff --git a/python/ovs/db/data.py b/python/ovs/db/data.py index 99bf80ed6

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-10-12 Thread Terry Wilson
On Mon, Sep 20, 2021 at 1:18 PM Ilya Maximets wrote: > > On 9/20/21 20:10, Terry Wilson wrote: > > The problem is that has_ever_connected() doesn't imply that we have > > downloaded the db into memory since the _Server stuff was added. > > Hmm. That doe

Re: [ovs-dev] [PATCH] python: replace pyOpenSSL with ssl

2021-09-29 Thread Terry Wilson
I'll take a look this morning and run it through the neutron ml2/ovn SSL-related tests. Terry On Fri, Sep 10, 2021 at 9:34 AM Timothy Redaelli wrote: > > Currently, pyOpenSSL is half-deprecated upstream and so it's removed on > some distributions (for example on CentOS Stream 9, >

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
The problem is that has_ever_connected() doesn't imply that we have downloaded the db into memory since the _Server stuff was added. On Mon, Sep 20, 2021 at 1:05 PM Ilya Maximets wrote: > > On 9/20/21 19:58, Terry Wilson wrote: > > On Mon, Sep 20, 2021 at 12:29 PM Ilya Max

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
On Mon, Sep 20, 2021 at 12:29 PM Ilya Maximets wrote: > > On 9/20/21 18:15, Terry Wilson wrote: > > On Thu, Sep 2, 2021 at 10:53 AM Dumitru Ceara wrote: > >> > >> On 9/2/21 5:34 PM, Terry Wilson wrote: > >>> This ports the C IDL change f50714b to the

Re: [ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-20 Thread Terry Wilson
On Thu, Sep 2, 2021 at 10:53 AM Dumitru Ceara wrote: > > On 9/2/21 5:34 PM, Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > > > Until now the code here would happily try to send transactions to the > > database server e

[ovs-dev] [PATCH v3] [python] Avoid sending transactions when the DB is not synced up

2021-09-02 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index ecae5e143..87ee06cde 100644 --- a/python/ovs/db/idl.py +++ b

[ovs-dev] [PATCH v2] [python] Avoid sending transactions when the DB is not synced up

2021-09-02 Thread Terry Wilson
for a database that the IDL had just learned did not exist on the server. Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index ecae5e143..f24dc5eaf 100644 --- a/python/ovs/db/idl.py +++ b

Re: [ovs-dev] [PATCH] [python] Avoid sending transactions when the DB is not synced up

2021-09-01 Thread Terry Wilson
/c39751e44539a014e642bcd930cb9e3a33af1805 was the update notification from the monitor request. Now that there are requests for _Server, etc., that no longer works. On Wed, Sep 1, 2021 at 11:15 AM Terry Wilson wrote: > > This ports the C IDL change f50714b to the Python IDL: > > Until now the code here would happily

  1   2   >