From 1b1d2e6daa563cc91f974ffdc082fb3a8b424801 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 31 Dec 2017 21:15:58 -0800 Subject: ovsdb: Introduce experimental support for clustered databases. This commit adds support for OVSDB clustering via Raft. Please read ovsdb(7) for information on how to set up a clustered database. It is simple and boils down to running "ovsdb-tool create-cluster" on one server and "ovsdb-tool join-cluster" on each of the others and then starting ovsdb-server in the usual way on all of them. One you have a clustered database, you configure ovn-controller and ovn-northd to use it by pointing them to all of the servers, e.g. where previously you might have said "tcp:1.2.3.4" was the database server, now you say that it is "tcp:1.2.3.4,tcp:5.6.7.8,tcp:9.10.11.12". This also adds support for database clustering to ovs-sandbox. Acked-by: Justin Pettit Tested-by: aginwala Signed-off-by: Ben Pfaff --- ovsdb/transaction.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'ovsdb/transaction.h') diff --git a/ovsdb/transaction.h b/ovsdb/transaction.h index f9b886411..32384fcd3 100644 --- a/ovsdb/transaction.h +++ b/ovsdb/transaction.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2017 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,12 +27,23 @@ struct uuid; struct ovsdb_txn *ovsdb_txn_create(struct ovsdb *); void ovsdb_txn_abort(struct ovsdb_txn *); -struct ovsdb_error *ovsdb_txn_start_commit(struct ovsdb_txn *) +struct ovsdb_error *ovsdb_txn_replay_commit(struct ovsdb_txn *) OVS_WARN_UNUSED_RESULT; -struct ovsdb_error *ovsdb_txn_finish_commit(struct ovsdb_txn *, bool durable) +struct ovsdb_txn_progress *ovsdb_txn_propose_commit(struct ovsdb_txn *, + bool durable) OVS_WARN_UNUSED_RESULT; -struct ovsdb_error *ovsdb_txn_commit(struct ovsdb_txn *, bool durable) +struct ovsdb_error *ovsdb_txn_propose_commit_block(struct ovsdb_txn *, + bool durable) OVS_WARN_UNUSED_RESULT; +void ovsdb_txn_complete(struct ovsdb_txn *); + +struct ovsdb_txn_progress *ovsdb_txn_propose_schema_change( + struct ovsdb *, const struct json *schema, const struct json *data); + +bool ovsdb_txn_progress_is_complete(const struct ovsdb_txn_progress *); +const struct ovsdb_error *ovsdb_txn_progress_get_error( + const struct ovsdb_txn_progress *); +void ovsdb_txn_progress_destroy(struct ovsdb_txn_progress *); struct ovsdb_row *ovsdb_txn_row_modify(struct ovsdb_txn *, const struct ovsdb_row *); -- cgit v1.2.1