2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ovsdb: replication: Automatically switch read-only mode.

When database is added to the replication, it should no longer
accept transactions that can modify it.  When it's removed from
the replication, it should be writable again.  Add this logic
to the replication module itself, so it can be removed from the
main ovsdb-server later.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
Ilya Maximets
2024-01-09 23:49:06 +01:00
parent 3ff980c854
commit c8c0e570dc

View File

@@ -150,6 +150,7 @@ replication_set_db(struct ovsdb *db, const char *sync_from,
jsonrpc_session_set_probe_interval(rdb->session, probe_interval);
rdb->state = RPL_S_INIT;
rdb->db->read_only = true;
}
void
@@ -727,6 +728,7 @@ replication_db_destroy(struct replication_db *rdb)
}
rdb->schema_version_higher = false;
rdb->db->read_only = false;
}
/* Return true if replication just started or is ongoing.