summaryrefslogtreecommitdiff
path: root/lib/ovsdb-cs.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2021-12-19 15:09:39 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-03 15:21:21 +0100
commita3e97b1af1bdcaa802c6caa9e73087df7077d2b1 (patch)
tree874bc2376b871a5987605eab6b7365f7d8f7ef26 /lib/ovsdb-cs.c
parent999ba294fb4f9a39db77070f0b2045bf166c2287 (diff)
downloadopenvswitch-a3e97b1af1bdcaa802c6caa9e73087df7077d2b1.tar.gz
ovsdb: relay: Add transaction history support.
Even though relays can be scaled to the big number of servers to handle a lot more clients, lack of transaction history may cause significant load if clients are re-connecting. E.g. in case of the upgrade of a large-scale OVN deployment, relays can be taken down one by one forcing all the clients of one relay to jump to other ones. And all these clients will download the database from scratch from a new relay. Since relay itself supports monitor_cond_since connection to the main cluster, it receives the last transaction id along with each update. Since these transaction ids are 'eid's of actual transactions, they can be used by relay for a transaction history. Relay may not receive all the transaction ids, because the main cluster may combine several changes into a single monitor update. However, all relays will, likely, receive same updates with the same transaction ids, so the case where transaction id can not be found after re-connection between relays should not be very common. If some id is missing on the relay (i.e. this update was merged with some other update and newer id was used) the client will just re-download the database as if there was a normal transaction history miss. OVSDB client synchronization module updated to provide the last transaction id along with the update. Relay module updated to use these ids as a transaction id. If ids are zero, relay decides that the main server doesn't support transaction ids and disables the transaction history accordingly. Using ovsdb_txn_replay_commit() instead of ovsdb_txn_propose_commit_block(), so transactions are added to the history. This can be done, because relays has no file storage, so there is no need to write anything. Relay tests modified to test both standalone and clustered database as a main server. Checks added to ensure that all servers receive the same transaction ids in monitor updates. Acked-by: Mike Pattrick <mkp@redhat.com> Acked-by: Han Zhou <hzhou@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib/ovsdb-cs.c')
-rw-r--r--lib/ovsdb-cs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ovsdb-cs.c b/lib/ovsdb-cs.c
index dead31275..031bbca06 100644
--- a/lib/ovsdb-cs.c
+++ b/lib/ovsdb-cs.c
@@ -1546,6 +1546,7 @@ ovsdb_cs_db_add_update(struct ovsdb_cs_db *db,
.clear = clear,
.monitor_reply = monitor_reply,
.version = version,
+ .last_id = db->last_id,
};
}