Re: [ovs-dev] [PATCH] ovsdb-cs: fix 'cs_db' lock flag not updated error.

2023-05-04 Thread


在 2023/5/5 10:55, 汪翰林 写道:


在 2023/5/4 18:14, Ilya Maximets 写道:

On 5/4/23 12:12, Ilya Maximets wrote:

On 4/11/23 11:07, 汪翰林 wrote:

在 2023/4/7 21:20, Simon Horman 写道:

On Fri, Apr 07, 2023 at 02:59:04PM +0800, wanghanlin wrote:

When 'cs' is not connected to a server, then
ovsdb_cs_db_compose_lock_request__ will update
'cs_db' lock flag, but the lock flag will not
be updated next.

Signed-off-by: wanghanlin 

Hi,

Are there also error conditions where this situation can arise?

This happens when reconnect_disable is called.

Hi.  Why exactly this condition is bad?  While composing the
lock request the 'has_lock' flag will be dropped to 'false'.
The lock request will be created, but the send will fail, since
there is no connection.  However, this shouldn't have any
consequences, because we do not claim to have a lock.  Once we
re-connect a new request should be formed and sent out.  Or am
I missing something?

Even worse, if we do not drop the flag, the application will still
think that it has the lock, while it doesn't.


Best regards, Ilya Maximets.



In bridge_run,  ovsdb_idl_has_lock will check the 'has_lock' flag and 
return immediately when 'has_lock' is false.




Because ovs process flow configuration in connmgr_run called by 
bridge_run__, then flow configure will not work now.


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


Re: [ovs-dev] [PATCH] ovsdb-cs: fix 'cs_db' lock flag not updated error.

2023-05-04 Thread


在 2023/5/4 18:14, Ilya Maximets 写道:

On 5/4/23 12:12, Ilya Maximets wrote:

On 4/11/23 11:07, 汪翰林 wrote:

在 2023/4/7 21:20, Simon Horman 写道:

On Fri, Apr 07, 2023 at 02:59:04PM +0800, wanghanlin wrote:

When 'cs' is not connected to a server, then
ovsdb_cs_db_compose_lock_request__ will update
'cs_db' lock flag, but the lock flag will not
be updated next.

Signed-off-by: wanghanlin 

Hi,

Are there also error conditions where this situation can arise?

This happens when reconnect_disable is called.

Hi.  Why exactly this condition is bad?  While composing the
lock request the 'has_lock' flag will be dropped to 'false'.
The lock request will be created, but the send will fail, since
there is no connection.  However, this shouldn't have any
consequences, because we do not claim to have a lock.  Once we
re-connect a new request should be formed and sent out.  Or am
I missing something?

Even worse, if we do not drop the flag, the application will still
think that it has the lock, while it doesn't.


Best regards, Ilya Maximets.



In bridge_run,  ovsdb_idl_has_lock will check the 'has_lock' flag and 
return immediately when 'has_lock' is false.


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


Re: [ovs-dev] [PATCH] ovsdb-cs: fix 'cs_db' lock flag not updated error.

2023-04-11 Thread


在 2023/4/7 21:20, Simon Horman 写道:

On Fri, Apr 07, 2023 at 02:59:04PM +0800, wanghanlin wrote:

When 'cs' is not connected to a server, then
ovsdb_cs_db_compose_lock_request__ will update
'cs_db' lock flag, but the lock flag will not
be updated next.

Signed-off-by: wanghanlin 

Hi,

Are there also error conditions where this situation can arise?

This happens when reconnect_disable is called.

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


[ovs-dev] [PATCH] ovsdb-cs: fix 'cs_db' lock flag not free error.

2023-04-06 Thread

When 'cs' is not connected to a server, then
ovsdb_cs_db_compose_lock_request__ will update
'cs_db' lock flag, but the lock flag will not
be updated next.

Signed-off-by: wanghanlin 
---
 lib/ovsdb-cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index c7c147cc0..f909a66f9 100644
--- a/lib/ovsdb-cs.c
+++ b/lib/ovsdb-cs.c
@@ -632,7 +632,7 @@ ovsdb_cs_run(struct ovsdb_cs *cs, struct ovs_list 
*events)


 ovsdb_cs_db_add_event(&cs->data, OVSDB_CS_EVENT_TYPE_RECONNECT);

-    if (cs->data.lock_name) {
+    if (cs->data.lock_name && ovsdb_cs_is_connected(cs)) {
 jsonrpc_session_send(
 cs->session,
ovsdb_cs_db_compose_lock_request(&cs->data));
--
2.34.1

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


[ovs-dev] [PATCH] ovsdb-cs: fix 'cs_db' lock flag not free error.

2023-04-06 Thread

When 'cs' is not connected to a server, then
ovsdb_cs_db_compose_lock_request__ will update
'cs_db' lock flag, but the lock flag will not
be free next.

Signed-off-by: wanghanlin 
---
 lib/ovsdb-cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index c7c147cc0..f909a66f9 100644
--- a/lib/ovsdb-cs.c
+++ b/lib/ovsdb-cs.c
@@ -632,7 +632,7 @@ ovsdb_cs_run(struct ovsdb_cs *cs, struct ovs_list 
*events)


 ovsdb_cs_db_add_event(&cs->data, OVSDB_CS_EVENT_TYPE_RECONNECT);

-    if (cs->data.lock_name) {
+    if (cs->data.lock_name && ovsdb_cs_is_connected(cs)) {
 jsonrpc_session_send(
 cs->session,
ovsdb_cs_db_compose_lock_request(&cs->data));
--
2.34.1

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