diff mbox

[ovs-dev,1/3] ovsdb-idl: Avoid sending redundant conditional monitoring updates

Message ID 1482227237-61638-1-git-send-email-azhou@ovn.org
State Accepted
Headers show

Commit Message

Andy Zhou Dec. 20, 2016, 9:47 a.m. UTC
In case connection is reset when there are buffered but unsent
conditions, these conditions will be sent as the new "monitor_cond"
message that will be sent after the idl reconnects.

Without this patch, those conditions will be unnecessarily sent again
with following monitoring condition update message.

Signed-off-by: Andy Zhou <azhou@ovn.org>
---
 lib/ovsdb-idl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ben Pfaff Dec. 22, 2016, 4:56 p.m. UTC | #1
On Tue, Dec 20, 2016 at 01:47:15AM -0800, Andy Zhou wrote:
> In case connection is reset when there are buffered but unsent
> conditions, these conditions will be sent as the new "monitor_cond"
> message that will be sent after the idl reconnects.
> 
> Without this patch, those conditions will be unnecessarily sent again
> with following monitoring condition update message.
> 
> Signed-off-by: Andy Zhou <azhou@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Andy Zhou Jan. 6, 2017, 10:44 p.m. UTC | #2
On Thu, Dec 22, 2016 at 8:56 AM, Ben Pfaff <blp@ovn.org> wrote:

> On Tue, Dec 20, 2016 at 01:47:15AM -0800, Andy Zhou wrote:
> > In case connection is reset when there are buffered but unsent
> > conditions, these conditions will be sent as the new "monitor_cond"
> > message that will be sent after the idl reconnects.
> >
> > Without this patch, those conditions will be unnecessarily sent again
> > with following monitoring condition update message.
> >
> > Signed-off-by: Andy Zhou <azhou@ovn.org>
>
> Acked-by: Ben Pfaff <blp@ovn.org>
>
Thanks. Pushed to master.
diff mbox

Patch

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 1be1c68..218b6b3 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -345,6 +345,7 @@  ovsdb_idl_clear(struct ovsdb_idl *idl)
         struct ovsdb_idl_table *table = &idl->tables[i];
         struct ovsdb_idl_row *row, *next_row;
 
+        table->cond_changed = false;
         if (hmap_is_empty(&table->rows)) {
             continue;
         }
@@ -370,6 +371,7 @@  ovsdb_idl_clear(struct ovsdb_idl *idl)
         }
     }
 
+    idl->cond_changed = false;
     ovsdb_idl_track_clear(idl);
 
     if (changed) {