summaryrefslogtreecommitdiff
path: root/ovsdb/trigger.c
diff options
context:
space:
mode:
authorIlya Maximets <i.maximets@ovn.org>2023-03-27 21:42:57 +0200
committerIlya Maximets <i.maximets@ovn.org>2023-04-24 22:47:56 +0200
commitefcdf6c0de58b2f29a6f5467b1a2b0d33fdc6955 (patch)
treee5f0f7262ccce8e46d6828bc9c83d29b77d73030 /ovsdb/trigger.c
parentbf39ea3c79ee343a87a07cdff8fef2eb0c64dad9 (diff)
downloadopenvswitch-efcdf6c0de58b2f29a6f5467b1a2b0d33fdc6955.tar.gz
ovsdb: Check for ephemeral columns before writing a new schema.
Clustered databases do not support ephemeral columns, but ovsdb-server checks for them after the conversion result is read from the storage. It's much easier to recover if this constraint is checked before writing to the storage instead. It's not a big problem, because the check is always performed by the native ovsdb clients before sending a conversion request. But the server, in general, should not trust clients to do the right thing. Check in the update_schema() remains, because we shouldn't blindly trust the storage. Reviewed-by: Simon Horman <simon.horman@corigine.com> Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb/trigger.c')
-rw-r--r--ovsdb/trigger.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ovsdb/trigger.c b/ovsdb/trigger.c
index 7d3003bca..3a693855b 100644
--- a/ovsdb/trigger.c
+++ b/ovsdb/trigger.c
@@ -274,8 +274,8 @@ ovsdb_trigger_try(struct ovsdb_trigger *t, long long int now)
if (!error) {
error = ovsdb_convert(t->db, new_schema, &newdb);
}
- ovsdb_schema_destroy(new_schema);
if (error) {
+ ovsdb_schema_destroy(new_schema);
trigger_convert_error(t, error);
return false;
}
@@ -286,7 +286,8 @@ ovsdb_trigger_try(struct ovsdb_trigger *t, long long int now)
/* Propose the change. */
t->progress = ovsdb_txn_propose_schema_change(
- t->db, new_schema_json, txn_json);
+ t->db, new_schema, txn_json);
+ ovsdb_schema_destroy(new_schema);
json_destroy(txn_json);
t->reply = jsonrpc_create_reply(json_object_create(),
t->request->id);