2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb: Add replication wait

Poll_block() requires the run() function to be paired with a wait()
function. Add one for replication.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Andy Zhou
2016-07-28 15:48:28 -07:00
parent f53d75183f
commit 8c945cece4
3 changed files with 12 additions and 0 deletions

View File

@@ -183,6 +183,9 @@ main_loop(struct ovsdb_jsonrpc_server *jsonrpc, struct shash *all_dbs,
} }
memory_wait(); memory_wait();
if (is_backup_server) {
replication_wait();
}
ovsdb_jsonrpc_server_wait(jsonrpc); ovsdb_jsonrpc_server_wait(jsonrpc);
unixctl_server_wait(unixctl); unixctl_server_wait(unixctl);
SHASH_FOR_EACH(node, all_dbs) { SHASH_FOR_EACH(node, all_dbs) {

View File

@@ -111,6 +111,14 @@ replication_run(struct shash *all_dbs)
} }
} }
void
replication_wait(void)
{
if (rpc) {
jsonrpc_wait(rpc);
}
}
void void
set_active_ovsdb_server(const char *active_server) set_active_ovsdb_server(const char *active_server)
{ {

View File

@@ -32,6 +32,7 @@ struct db {
void replication_init(void); void replication_init(void);
void replication_run(struct shash *dbs); void replication_run(struct shash *dbs);
void replication_wait(void);
void set_active_ovsdb_server(const char *remote_server); void set_active_ovsdb_server(const char *remote_server);
const char *get_active_ovsdb_server(void); const char *get_active_ovsdb_server(void);
void set_tables_blacklist(const char *blacklist); void set_tables_blacklist(const char *blacklist);