summaryrefslogtreecommitdiff
path: root/ovsdb/monitor.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-28 13:21:11 -0800
committerBen Pfaff <blp@ovn.org>2018-03-24 12:04:52 -0700
commit53178986d7fc86bcfc2f297b547a97ee71a21bb7 (patch)
treebc01be74235a8c3e2cb80180f64c0ef61fac0ab3 /ovsdb/monitor.c
parent10621d795331a3ddddb3e96086a9fda7ad156efc (diff)
downloadopenvswitch-53178986d7fc86bcfc2f297b547a97ee71a21bb7.tar.gz
ovsdb: Add support for online schema conversion.
With this change, "ovsdb-client convert" can be used to convert a database from one schema to another without taking the database offline. This can be useful to minimize downtime for a database during a software upgrade. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'ovsdb/monitor.c')
-rw-r--r--ovsdb/monitor.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 8c3053722..dd06e265e 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -1612,7 +1612,7 @@ ovsdb_monitors_remove(struct ovsdb *db)
/* Delete all front-end monitors. Removing the last front-end monitor
* will also destroy the corresponding ovsdb_monitor. */
LIST_FOR_EACH_SAFE (jm, next_jm, node, &m->jsonrpc_monitors) {
- ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor);
+ ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor, false);
}
}
}
@@ -1629,3 +1629,19 @@ ovsdb_monitor_get_memory_usage(struct simap *usage)
simap_increase(usage, "json-caches", hmap_count(&dbmon->json_cache));
}
}
+
+void
+ovsdb_monitor_prereplace_db(struct ovsdb *db)
+{
+ struct ovsdb_monitor *m, *next_m;
+
+ LIST_FOR_EACH_SAFE (m, next_m, list_node, &db->monitors) {
+ struct jsonrpc_monitor_node *jm, *next_jm;
+
+ /* Delete all front-end monitors. Removing the last front-end monitor
+ * will also destroy the corresponding ovsdb_monitor. */
+ LIST_FOR_EACH_SAFE (jm, next_jm, node, &m->jsonrpc_monitors) {
+ ovsdb_jsonrpc_monitor_destroy(jm->jsonrpc_monitor, true);
+ }
+ }
+}