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:
@@ -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) {
|
||||||
|
@@ -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)
|
||||||
{
|
{
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user