This patch series implements conditional monitoring by introducing an OVSDB RFC extension with 2 new JSON-RPC methods: "monitor_cond" and "monitor_cond_update". Specification of this extension is defined in the ovsdb-server (1) man page. Monitor2 is now merged into monitor_cond. A monitor_cond session with an empty condition, will behave exactly like monitor2 and will get update2 notifications on all rows.
This patch series is also available on: https://github.com/liranschour/ovs.git branch monitor_cond_ovn. OVN: Last patch in this series is a RFC for OVN usage of conditional monitoring. Performance: JSON cache for full update notification is enabled only for none-conditional monitoring or true conditons (explicit or implicit). Table JSON cache is enabled only for none-conditional tables or for tables with none or true condition. Tables with conditon compounds from "==" or "includes" functions only (which is the most common case in conditional monitoring), track changes according to condition clauses match. By that we want to limit computation of tracking a row change in O(#clauses's columns) and composing update notification in O(#changes to be sent). Other conditional monior sessions, with condition's functions other then "=="|"includes". We expect that computation of server side will be high. v4->v5: * Bug fix in changes tracking according to condition's clauses * Bug fix raised by OVN end-to-end tests * Code review fix v3->v4: * Enable tracking of changes according to condition's clauses in case of "==" condition * Enable table JSON cache for tables with true condition * Add test for conditional monitoring of multiple tables * Add remove clause API to ovsdb_idl to allow clients iterative workflow * flake8 fixes * On composing update on conditon update use ovsdb_row instead of maintaing changes list of ovsdb_monitor_row * Add condition utilities for clause tracking v2-v3: * monitor_cond_update method receives a single json condition * Support non-monitored columns in condition * Simplify IDL API for iteratively build condition by client * Bug fixes * Style issues v1->v2: * Change monitor_cond_change to monitor_cond_update * monitor_cond_update spec allows now to change monitored columns (unsupported) * Use new <json-value> as a session ID as a result of monitor_cond_update command. * Clarifications in ovsdb-server(1) man page. * Bug fix in ovsdb_monitor_get_all_rows() * Fix style issues Liran Schour (18): ovsdb: create column index mapping between ovsdb row to monitor row ovsdb: add conditions utilities to support monitor_cond ovsdb: allow unmonitored columns in condition evaluation ovsdb: generate update notifications for monitor_cond session ovsdb: enable JSON cache for none conditional monitored tables ovsdb-client: support monitor-cond method ovsdb: enable jsonrpc-server to service "monitor_cond_update" request lib: add to ovsdb-idl monitor_id lib: add monitor_cond_update API to C IDL lib python: move Python idl to work with monitor_cond tests: add testing for idl conditional monitoring ovsdb: add FALSE mode for tables with false condition ovsdb: adjust ovsdb_monitor_changes to hold rows by either transaction id or datum ovsdb: Implement data structure to hold changed rows that matches condition's clauses ovsdb: Add EQ_COND mode to ovsdb_monitor_table_condition ovsdb: track changed rows by clauses match ovsdb: lazy cleanup of clauses matched row changes RFC OVN: Quick implementation of conditional monitoring NEWS | 3 +- lib/ovsdb-idl-provider.h | 13 + lib/ovsdb-idl.c | 250 ++++++++- lib/ovsdb-idl.h | 39 ++ ovn/controller/binding.c | 93 ++++ ovn/controller/lflow.c | 41 +- ovn/controller/ovn-controller.c | 28 + ovn/controller/ovn-controller.h | 6 + ovsdb/condition.c | 248 ++++++++- ovsdb/condition.h | 33 +- ovsdb/jsonrpc-server.c | 222 +++++++- ovsdb/jsonrpc-server.h | 2 +- ovsdb/monitor.c | 1152 +++++++++++++++++++++++++++++++++++---- ovsdb/monitor.h | 35 +- ovsdb/ovsdb-client.1.in | 37 +- ovsdb/ovsdb-client.c | 70 ++- ovsdb/ovsdb-idlc.in | 336 ++++++++++++ ovsdb/ovsdb-server.1.in | 230 +++++++- ovsdb/ovsdb-server.c | 20 +- ovsdb/query.c | 6 +- python/ovs/db/data.py | 16 +- python/ovs/db/idl.py | 172 +++++- tests/ovs-vswitchd.at | 8 +- tests/ovsdb-condition.at | 41 ++ tests/ovsdb-idl.at | 243 ++++++++- tests/ovsdb-monitor.at | 207 +++++++ tests/test-ovsdb.c | 265 ++++++++- tests/test-ovsdb.py | 27 + 28 files changed, 3580 insertions(+), 263 deletions(-) -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev