[ovs-dev,1/2] ovsdb: Move trigger_run after storage_run and read_db.

Message ID 1551466597-87991-1-git-send-email-hzhou8@ebay.com
State New
Headers show
Series
  • [ovs-dev,1/2] ovsdb: Move trigger_run after storage_run and read_db.
Related show

Commit Message

Han Zhou March 1, 2019, 6:56 p.m.
From: Han Zhou <hzhou8@ebay.com>

Run triggers after storage_run and read_db to make sure new raft
updates are utilized in current iteration.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
---
 ovsdb/ovsdb-server.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Ben Pfaff March 4, 2019, 6:57 p.m. | #1
On Fri, Mar 01, 2019 at 10:56:36AM -0800, Han Zhou wrote:
> From: Han Zhou <hzhou8@ebay.com>
> 
> Run triggers after storage_run and read_db to make sure new raft
> updates are utilized in current iteration.
> 
> Signed-off-by: Han Zhou <hzhou8@ebay.com>

Thanks.  I applied this patch to master.

I have not looked at patch 2 yet.

Patch

diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 4e97de8..9dc1d57 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -220,6 +220,10 @@  main_loop(struct server_config *config,
         SHASH_FOR_EACH_SAFE (node, next, all_dbs) {
             struct db *db = node->data;
             ovsdb_txn_history_run(db->db);
+            ovsdb_storage_run(db->db->storage);
+            read_db(config, db);
+            /* Run triggers after storage_run and read_db to make sure new raft
+             * updates are utilized in current iteration. */
             if (ovsdb_trigger_run(db->db, time_msec())) {
                 /* The message below is currently the only reason to disconnect
                  * all clients. */
@@ -228,8 +232,6 @@  main_loop(struct server_config *config,
                     xasprintf("committed %s database schema conversion",
                               db->db->name));
             }
-            ovsdb_storage_run(db->db->storage);
-            read_db(config, db);
             if (ovsdb_storage_is_dead(db->db->storage)) {
                 VLOG_INFO("%s: removing database because storage disconnected "
                           "permanently", node->name);