<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/python/ovs/db, branch master</title>
<subtitle>github.com: openvswitch/ovs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/'/>
<entry>
<title>ovsdb-cs: Consider default conditions implicitly acked.</title>
<updated>2022-12-13T17:52:10+00:00</updated>
<author>
<name>Dumitru Ceara</name>
<email>dceara@redhat.com</email>
</author>
<published>2022-12-13T17:11:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=a787fbbf9dd6a108a53053afb45fb59a0b58b514'/>
<id>a787fbbf9dd6a108a53053afb45fb59a0b58b514</id>
<content type='text'>
When initializing a monitor table the default monitor condition is
[True] which matches the behavior of the server (to send all rows of
that table).  There's no need to include this default condition in the
initial monitor request so we can consider it implicitly acked by the
server.

This fixes the incorrect (one too large) expected condition sequence
number reported by ovsdb_idl_set_condition() when application is
trying to set a [True] condition for a new table.

Reported-by: Numan Siddique &lt;numans@ovn.org&gt;
Suggested-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When initializing a monitor table the default monitor condition is
[True] which matches the behavior of the server (to send all rows of
that table).  There's no need to include this default condition in the
initial monitor request so we can consider it implicitly acked by the
server.

This fixes the incorrect (one too large) expected condition sequence
number reported by ovsdb_idl_set_condition() when application is
trying to set a [True] condition for a new table.

Reported-by: Numan Siddique &lt;numans@ovn.org&gt;
Suggested-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ovsdb-idl: Add the support to specify the uuid for row insert.</title>
<updated>2022-11-30T14:15:57+00:00</updated>
<author>
<name>Numan Siddique</name>
<email>numans@ovn.org</email>
</author>
<published>2022-11-28T03:56:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=55b9507e6824b935ffa0205fc7c7bebfe4e54279'/>
<id>55b9507e6824b935ffa0205fc7c7bebfe4e54279</id>
<content type='text'>
ovsdb-server allows the OVSDB clients to specify the uuid for
the row inserts [1].  Both the C IDL client library and Python
IDL are missing this feature.  This patch adds this support.

In C IDL, for each schema table, a new function is generated -
&lt;schema_table&gt;insert_persistent_uuid(txn, uuid) which can
be used the clients to persist the uuid.

ovs-vsctl and other derivatives of ctl now supports the same
in the generic 'create' command with the option "--id=&lt;UUID&gt;".

In Python IDL, the uuid to persist can be specified in
the Transaction.insert() function.

[1] - a529e3cd1f("ovsdb-server: Allow OVSDB clients to specify the UUID for inserted rows.:)

Acked-by: Adrian Moreno &lt;amorenoz@redhat.com&gt;
Acked-by: Han Zhou &lt;hzhou@ovn.org&gt;
Acked-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Numan Siddique &lt;numans@ovn.org&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ovsdb-server allows the OVSDB clients to specify the uuid for
the row inserts [1].  Both the C IDL client library and Python
IDL are missing this feature.  This patch adds this support.

In C IDL, for each schema table, a new function is generated -
&lt;schema_table&gt;insert_persistent_uuid(txn, uuid) which can
be used the clients to persist the uuid.

ovs-vsctl and other derivatives of ctl now supports the same
in the generic 'create' command with the option "--id=&lt;UUID&gt;".

In Python IDL, the uuid to persist can be specified in
the Transaction.insert() function.

[1] - a529e3cd1f("ovsdb-server: Allow OVSDB clients to specify the UUID for inserted rows.:)

Acked-by: Adrian Moreno &lt;amorenoz@redhat.com&gt;
Acked-by: Han Zhou &lt;hzhou@ovn.org&gt;
Acked-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Numan Siddique &lt;numans@ovn.org&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Fix idl.Row.__str__ method.</title>
<updated>2022-09-19T16:33:48+00:00</updated>
<author>
<name>Christopher Aubut</name>
<email>christopher@aubut.me</email>
</author>
<published>2022-07-13T15:53:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=a39ee99edc26a3bf2fec8f6081f140567af54129'/>
<id>a39ee99edc26a3bf2fec8f6081f140567af54129</id>
<content type='text'>
Fixes idl.Row's __str__ method to only print if the column exists on
the object.  The Row object passed to the 'updates' argument of
Idl.notify only contains a subset of columns.  Printing that argument
causes an AttributeError.

Fixes: 6a1c98461b46 ("Add a __str__ method to idl.Row")
Submitted-at: https://github.com/openvswitch/ovs/pull/392
Acked-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Christopher Aubut &lt;christopher@aubut.me&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes idl.Row's __str__ method to only print if the column exists on
the object.  The Row object passed to the 'updates' argument of
Idl.notify only contains a subset of columns.  Printing that argument
causes an AttributeError.

Fixes: 6a1c98461b46 ("Add a __str__ method to idl.Row")
Submitted-at: https://github.com/openvswitch/ovs/pull/392
Acked-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Christopher Aubut &lt;christopher@aubut.me&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Fix E275 missing whitespace after keyword.</title>
<updated>2022-08-04T16:13:20+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@ovn.org</email>
</author>
<published>2022-08-04T13:56:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=434025a15453452f76962b5f625dbe30c61615fd'/>
<id>434025a15453452f76962b5f625dbe30c61615fd</id>
<content type='text'>
With just released flake8 5.0 we're getting a bunch of E275 errors:

 utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after keyword
 tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword
 python/setup.py:105:8: E275 missing whitespace after keyword
 python/setup.py:106:8: E275 missing whitespace after keyword
 python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword
 python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword
 make[2]: *** [flake8-check] Error 1

This breaks CI on branches below 2.16.  We don't see a problem right
now on newer branches because we're installing extra dependencies
that backtrack flake8 down to 4.1 or even 3.9.

Acked-by: Mike Pattrick &lt;mkp@redhat.com&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With just released flake8 5.0 we're getting a bunch of E275 errors:

 utilities/bugtool/ovs-bugtool.in:959:23: E275 missing whitespace after keyword
 tests/test-ovsdb.py:623:11: E275 missing whitespace after keyword
 python/setup.py:105:8: E275 missing whitespace after keyword
 python/setup.py:106:8: E275 missing whitespace after keyword
 python/ovs/db/idl.py:145:15: E275 missing whitespace after keyword
 python/ovs/db/idl.py:167:15: E275 missing whitespace after keyword
 make[2]: *** [flake8-check] Error 1

This breaks CI on branches below 2.16.  We don't see a problem right
now on newer branches because we're installing extra dependencies
that backtrack flake8 down to 4.1 or even 3.9.

Acked-by: Mike Pattrick &lt;mkp@redhat.com&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Raise AttributeError from uuid_to_row.</title>
<updated>2022-05-02T17:17:53+00:00</updated>
<author>
<name>Terry Wilson</name>
<email>twilson@redhat.com</email>
</author>
<published>2022-05-02T13:31:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=7d355544256a9a889a876250d357423f0b69a40d'/>
<id>7d355544256a9a889a876250d357423f0b69a40d</id>
<content type='text'>
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 appropriately raise an AttributeError.

After 4e3966e64, a KeyError would be raised, which is not expected
from a getattr() or hasattr() call, which could break existing
code.

Fixes: 4e3966e64bed ("python: Politely handle misuse of table.condition.")
Signed-off-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 appropriately raise an AttributeError.

After 4e3966e64, a KeyError would be raised, which is not expected
from a getattr() or hasattr() call, which could break existing
code.

Fixes: 4e3966e64bed ("python: Politely handle misuse of table.condition.")
Signed-off-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Politely handle misuse of table.condition.</title>
<updated>2022-04-26T22:36:28+00:00</updated>
<author>
<name>Terry Wilson</name>
<email>twilson@redhat.com</email>
</author>
<published>2022-04-13T13:52:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=4e3966e64beded4480141e0970526f6ef466aded'/>
<id>4e3966e64beded4480141e0970526f6ef466aded</id>
<content type='text'>
Before 46d44cf3b, it was technically possible to assign a monitor
condition directly to Idl.tables[table_name].condition. If done
before the connection was established, it would successfully apply
the condition (where cond_change() actually would fail).

Although this wasn't meant to be supported, several OpenStack
projects made use of this. After 46d44cf3b, .condition is no
longer a list, but a ConditionState. Assigning a list to it breaks
the Idl.

The Neutron and ovsdbapp projects have patches in-flight to
use Idl.cond_change() if ConditionState exists, as it now works
before connection as well, but here could be other users that also
start failing when upgrading to OVS 2.17.

Instead of directly adding attributes to TableSchema, this adds
the IdlTable/IdlColumn objects which hold Idl-specific data and
adds a 'condition' property to TableSchema that maintains the old
interface.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Terry Wilson &lt;twilson@redhat.com&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Acked-By: Timothy Redaelli &lt;tredaelli@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before 46d44cf3b, it was technically possible to assign a monitor
condition directly to Idl.tables[table_name].condition. If done
before the connection was established, it would successfully apply
the condition (where cond_change() actually would fail).

Although this wasn't meant to be supported, several OpenStack
projects made use of this. After 46d44cf3b, .condition is no
longer a list, but a ConditionState. Assigning a list to it breaks
the Idl.

The Neutron and ovsdbapp projects have patches in-flight to
use Idl.cond_change() if ConditionState exists, as it now works
before connection as well, but here could be other users that also
start failing when upgrading to OVS 2.17.

Instead of directly adding attributes to TableSchema, this adds
the IdlTable/IdlColumn objects which hold Idl-specific data and
adds a 'condition' property to TableSchema that maintains the old
interface.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Terry Wilson &lt;twilson@redhat.com&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Acked-By: Timothy Redaelli &lt;tredaelli@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Set cond_changed to true if condition change requested.</title>
<updated>2022-04-04T20:52:12+00:00</updated>
<author>
<name>Wentao Jia</name>
<email>wentao.jia@easystack.cn</email>
</author>
<published>2022-04-02T02:51:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=d29491eeb4a6e2128430eeac9a08327d8e7d8ed6'/>
<id>d29491eeb4a6e2128430eeac9a08327d8e7d8ed6</id>
<content type='text'>
cond_changed set to true if _req_cond (requested condition change)
is not none.  This can avoid falling into an endless poll loop,
because cond_changed is true will trigger immediate_wake().

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Wentao Jia &lt;wentao.jia@easystack.cn&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cond_changed set to true if _req_cond (requested condition change)
is not none.  This can avoid falling into an endless poll loop,
because cond_changed is true will trigger immediate_wake().

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Wentao Jia &lt;wentao.jia@easystack.cn&gt;
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Set cond_changed to false if last id is zero.</title>
<updated>2022-04-04T19:39:54+00:00</updated>
<author>
<name>Wentao Jia</name>
<email>wentao.jia@easystack.cn</email>
</author>
<published>2022-03-21T02:32:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=e3de0bd82d59fd8f4ccb7370c93d347f7621488f'/>
<id>e3de0bd82d59fd8f4ccb7370c93d347f7621488f</id>
<content type='text'>
After reconnection, cond_changed will be set to true, poll will be
called and never block causing cpu high load forever.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Wentao Jia &lt;wentao.jia@easystack.cn&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After reconnection, cond_changed will be set to true, poll will be
called and never block causing cpu high load forever.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Acked-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Wentao Jia &lt;wentao.jia@easystack.cn&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Clear last_id on reconnect if condition changes in-flight.</title>
<updated>2022-01-31T20:23:47+00:00</updated>
<author>
<name>Dumitru Ceara</name>
<email>dceara@redhat.com</email>
</author>
<published>2022-01-11T16:38:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=5202710a7862169161db4ebc84c410328a340c52'/>
<id>5202710a7862169161db4ebc84c410328a340c52</id>
<content type='text'>
When reconnecting, if there are condition changes already sent to the
server but not yet acked, reset the db's 'last-id', esentially clearing
the local cache after reconnect.

This is needed because the client cannot easily differentiate between
the following cases:
a. either the server already processed the requested monitor
   condition change but the FSM was restarted before the
   client was notified.  In this case the client should
   clear its local cache because it's out of sync with the
   monitor view on the server side.
b. OR the server hasn't processed the requested monitor
   condition change yet.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When reconnecting, if there are condition changes already sent to the
server but not yet acked, reset the db's 'last-id', esentially clearing
the local cache after reconnect.

This is needed because the client cannot easily differentiate between
the following cases:
a. either the server already processed the requested monitor
   condition change but the FSM was restarted before the
   client was notified.  In this case the client should
   clear its local cache because it's out of sync with the
   monitor view on the server side.
b. OR the server hasn't processed the requested monitor
   condition change yet.

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: idl: Resend requested but not acked conditions when reconnecting.</title>
<updated>2022-01-31T20:23:47+00:00</updated>
<author>
<name>Dumitru Ceara</name>
<email>dceara@redhat.com</email>
</author>
<published>2022-01-11T16:37:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/openvswitch.git/commit/?id=718dc8fca794307f4cda2d01c9552be8682e0fca'/>
<id>718dc8fca794307f4cda2d01c9552be8682e0fca</id>
<content type='text'>
When reconnecting forget about in-flight monitor condition changes
if the user requested a newer condition already.

This matches the C implementation, in ovsdb_cs_db_sync_condition().

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Acked-By: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When reconnecting forget about in-flight monitor condition changes
if the user requested a newer condition already.

This matches the C implementation, in ovsdb_cs_db_sync_condition().

Fixes: 46d44cf3be0d ("python: idl: Add monitor_cond_since support.")
Signed-off-by: Dumitru Ceara &lt;dceara@redhat.com&gt;
Acked-By: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@ovn.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
