mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +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:
parent
f53d75183f
commit
8c945cece4
@ -183,6 +183,9 @@ main_loop(struct ovsdb_jsonrpc_server *jsonrpc, struct shash *all_dbs,
|
||||
}
|
||||
|
||||
memory_wait();
|
||||
if (is_backup_server) {
|
||||
replication_wait();
|
||||
}
|
||||
ovsdb_jsonrpc_server_wait(jsonrpc);
|
||||
unixctl_server_wait(unixctl);
|
||||
SHASH_FOR_EACH(node, all_dbs) {
|
||||
|
@ -111,6 +111,14 @@ replication_run(struct shash *all_dbs)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
replication_wait(void)
|
||||
{
|
||||
if (rpc) {
|
||||
jsonrpc_wait(rpc);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
set_active_ovsdb_server(const char *active_server)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ struct db {
|
||||
|
||||
void replication_init(void);
|
||||
void replication_run(struct shash *dbs);
|
||||
void replication_wait(void);
|
||||
void set_active_ovsdb_server(const char *remote_server);
|
||||
const char *get_active_ovsdb_server(void);
|
||||
void set_tables_blacklist(const char *blacklist);
|
||||
|
Loading…
x
Reference in New Issue
Block a user