Here's a first version of the Raft-based clustering implementation. There is still significant work to do, but this is ready for people to take a basic look at.
If you want to try it out, the final commit message has some basic instructions, and a to-do list before it's really ready. You might find it easier to fetch this from my branch on github: https://github.com/blp/ovs-reviews/tree/raft7 Ben Pfaff (52): replication: Avoid theoretical use-after-free error in reset_database(). daemon-unix: With --monitor, only close standard fds if --detach also used. table: Avoid trailing white space in tables. util: Avoid trailing white space in hex dumps. ofp-print: Avoid trailing white space in OpenFlow dumps. jsonrpc: Allow jsonrpc_session to have more than one remote. socket-util: Make parse_bracketed_token() public, as inet_parse_token(). uuid: New function uuid_random(). json: New function json_nullable_clone(). json: New function json_object_put_format(). log: Allow client to specify magic. log: Require log entries to be JSON objects. log: Make json parameter to ovsdb_log_write() const. ovsdb-error: New function ovsdb_error_to_string_free(). ovsdb-error: New function ovsdb_error_to_json_free(). ovsdb-parser: New function ovsdb_parser_put_error(). ovsdb-data: Add OVS_WARN_UNUSED_RESULT annotations to function definitions. ovsdb-server: Distinguish logs from other replicas. ovsdb: Drop distinction between monitors and replicas. ovsdb-server: Drop 'txn' member from struct db. stream-unix: Give accepted sockets distinct names for log messages. test-ovsdb: Simplify code in do_trigger(). test-ovsdb: Triggers should wake up other triggers immediately. ovsdb-client: Show even invalid data in "dump" output. ovsdb-server: Document monitor_cond_change behavior for unmentioned tables. ovsdb-server: Forbid user-specified databases with reserved names. jsonrpc-server: Separate changing read_only status from reconnecting. table: Add --max-column-width option. jsonrpc-server: Enforce uniqueness of monitor IDs. jsonrpc-server: Report monitor session ID properly in error message. ovsdb-idl: Document state machine. ovsdb-idl: Fix assertion failure on error path parsing server reply. ovsdb-idl: Fix indentation in a couple of places. ovsdb-idl: Remove 'uuid' member of struct ovsdb_idl. ovsdb-idl: Add comments. ovsdb-idl: Fix spelling error in comment. ovsdb-idl: Verify insertion into singleton tables. ovsdb-idl: Break out database-specific stuff into new data structure. ovn-sbctl: Allow retries by default. tests: Always ignore "Broken pipe" and "Connection reset" log messages. reconnect: Add ability to do a number of retries without backoff. ovsdb-server: Add support for a built-in _Server database. ovsdb: Improve documentation. ovsdb-server: Add new RPC "set_db_change_aware". ovsdb-client: Move ovsdb-client specific tests to new .at file. ovsdb: Add support for online schema conversion. ovsdb-client; Add new "get-schema-cksum" command. ovsdb-client: Add new "backup" command. ovsdb-client: Add new "restore" command. ovsdb-client: Add new "query" command. ovsdb-tool: Add new "db-name" and "schema-name" commands. [RFC} ovsdb: Introduce support for clustered databases. Makefile.am | 8 - NEWS | 12 + build-aux/automake.mk | 12 +- build-aux/text2c | 16 + include/openvswitch/json.h | 7 +- lib/.gitignore | 3 + lib/automake.mk | 10 + lib/daemon-unix.c | 4 +- lib/json.c | 20 +- lib/jsonrpc.c | 66 +- lib/jsonrpc.h | 5 +- lib/ofp-print.c | 1 + lib/ovsdb-data.c | 115 +- lib/ovsdb-data.h | 16 + lib/ovsdb-error.c | 29 +- lib/ovsdb-error.h | 4 +- lib/ovsdb-idl-provider.h | 3 +- lib/ovsdb-idl.c | 1612 ++++++++------ lib/ovsdb-idl.h | 4 +- lib/ovsdb-parser.c | 14 +- lib/ovsdb-parser.h | 3 +- lib/ovsdb-server-idl.ann | 9 + lib/ovsdb-session.c | 72 + lib/ovsdb-session.h | 25 + lib/reconnect.c | 52 +- lib/reconnect.h | 3 + lib/socket-util.c | 14 +- lib/socket-util.h | 3 +- lib/stream-unix.c | 15 +- lib/table.c | 25 +- lib/table.h | 13 +- lib/table.man | 5 + lib/util.c | 7 +- lib/uuid.c | 8 + lib/uuid.h | 13 + manpages.mk | 56 +- ovn/controller/ovn-controller.8.xml | 5 +- ovn/controller/ovn-controller.c | 1 + ovn/northd/ovn-northd.8.xml | 6 +- ovn/utilities/ovn-sbctl.8.in | 19 +- ovn/utilities/ovn-sbctl.c | 2 +- ovsdb/.gitignore | 5 + ovsdb/TODO.rst | 64 + ovsdb/_server.ovsschema | 19 + ovsdb/_server.xml | 105 + ovsdb/automake.mk | 51 +- ovsdb/execution.c | 114 +- ovsdb/file.c | 651 +----- ovsdb/file.h | 33 +- ovsdb/jsonrpc-server.c | 319 ++- ovsdb/jsonrpc-server.h | 12 +- ovsdb/log.c | 457 +++- ovsdb/log.h | 32 +- ovsdb/monitor.c | 73 +- ovsdb/monitor.h | 10 +- ovsdb/ovsdb-client.1.in | 222 +- ovsdb/ovsdb-client.c | 533 ++++- ovsdb/ovsdb-idlc.in | 8 +- ovsdb/ovsdb-schemas.man | 19 + ovsdb/ovsdb-server.1.in | 286 ++- ovsdb/ovsdb-server.c | 539 +++-- ovsdb/ovsdb-tool.1.in | 227 +- ovsdb/ovsdb-tool.c | 511 ++++- ovsdb/ovsdb-util.c | 93 +- ovsdb/ovsdb-util.h | 9 + ovsdb/ovsdb.5.xml | 352 +++ ovsdb/ovsdb.7.xml | 742 +++++++ ovsdb/ovsdb.c | 115 +- ovsdb/ovsdb.h | 43 +- ovsdb/raft-private.c | 358 +++ ovsdb/raft-private.h | 123 ++ ovsdb/raft-rpc.c | 788 +++++++ ovsdb/raft-rpc.h | 271 +++ ovsdb/raft.c | 4105 +++++++++++++++++++++++++++++++++++ ovsdb/raft.h | 142 ++ ovsdb/remote-active.man | 17 - ovsdb/remote-active.xml | 30 - ovsdb/remote-passive.man | 19 - ovsdb/remote-passive.xml | 36 - ovsdb/replication-syn.man | 2 - ovsdb/replication.c | 10 +- ovsdb/replication.man | 23 - ovsdb/row.c | 3 + ovsdb/server.c | 14 +- ovsdb/server.h | 2 +- ovsdb/storage.c | 528 +++++ ovsdb/storage.h | 88 + ovsdb/transaction.c | 225 +- ovsdb/transaction.h | 20 +- ovsdb/trigger.c | 250 ++- ovsdb/trigger.h | 43 +- python/build/nroff.py | 15 +- python/ovs/reconnect.py | 53 +- tests/.gitignore | 1 + tests/automake.mk | 13 +- tests/ofp-errors.at | 44 +- tests/ofp-print.at | 16 +- tests/ofp-util.at | 18 +- tests/ofproto-macros.at | 13 + tests/ofproto.at | 2 +- tests/ovn-controller-vtep.at | 14 +- tests/ovn-nbctl.at | 14 +- tests/ovn-sbctl.at | 14 +- tests/ovs-ofctl.at | 20 +- tests/ovsdb-client.at | 73 + tests/ovsdb-cluster.at | 78 + tests/ovsdb-idl.at | 2 +- tests/ovsdb-log.at | 225 +- tests/ovsdb-monitor.at | 4 +- tests/ovsdb-replication.at | 12 +- tests/ovsdb-server.at | 399 +++- tests/ovsdb-tool.at | 72 +- tests/ovsdb-trigger.at | 2 +- tests/ovsdb.at | 2 + tests/reconnect.at | 56 +- tests/test-ovsdb.c | 69 +- tests/test-raft.c | 303 +++ tests/test-raft.sh | 13 + tests/test-raft2.sh | 12 + tests/test-raft3.sh | 14 + tests/test-raft4.sh | 37 + tests/test-reconnect.c | 8 + tests/test-reconnect.py | 5 + tests/torture-raft4.sh | 23 + tutorial/ovs-sandbox | 2 +- utilities/ovs-vsctl.8.in | 21 +- vswitchd/ovs-vswitchd.8.in | 7 +- vtep/vtep-ctl.8.in | 23 +- 128 files changed, 14116 insertions(+), 2641 deletions(-) create mode 100755 build-aux/text2c create mode 100644 lib/ovsdb-server-idl.ann create mode 100644 lib/ovsdb-session.c create mode 100644 lib/ovsdb-session.h create mode 100644 ovsdb/TODO.rst create mode 100644 ovsdb/_server.ovsschema create mode 100644 ovsdb/_server.xml create mode 100644 ovsdb/ovsdb-schemas.man create mode 100644 ovsdb/ovsdb.5.xml create mode 100644 ovsdb/ovsdb.7.xml create mode 100644 ovsdb/raft-private.c create mode 100644 ovsdb/raft-private.h create mode 100644 ovsdb/raft-rpc.c create mode 100644 ovsdb/raft-rpc.h create mode 100644 ovsdb/raft.c create mode 100644 ovsdb/raft.h delete mode 100644 ovsdb/remote-active.man delete mode 100644 ovsdb/remote-active.xml delete mode 100644 ovsdb/remote-passive.man delete mode 100644 ovsdb/remote-passive.xml delete mode 100644 ovsdb/replication-syn.man delete mode 100644 ovsdb/replication.man create mode 100644 ovsdb/storage.c create mode 100644 ovsdb/storage.h create mode 100644 tests/ovsdb-client.at create mode 100644 tests/ovsdb-cluster.at create mode 100644 tests/test-raft.c create mode 100755 tests/test-raft.sh create mode 100755 tests/test-raft2.sh create mode 100755 tests/test-raft3.sh create mode 100755 tests/test-raft4.sh create mode 100755 tests/torture-raft4.sh -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
