Diff records in a database file may contain sets larger than a maximum
set size, so constraints should not be checked on read.  They will be
checked later after applying the diff to a column.

Fixes: 2ccd66f594f7 ("ovsdb: Use column diffs for ovsdb and raft log entries.")
Reported-at: 
https://mail.openvswitch.org/pipermail/ovs-dev/2023-July/406685.html
Reported-by: Peng He <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
---
 ovsdb/file.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ovsdb/file.c b/ovsdb/file.c
index 400b34794..6e7e47ca6 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -107,7 +107,14 @@ ovsdb_file_update_row_from_json(struct ovsdb_row *row, 
bool converting,
                                       column_name, schema->name);
         }
 
-        error = ovsdb_datum_from_json(&datum, &column->type, node->data, NULL);
+        if (row_contains_diff) {
+            /* Diff may violate the type size rules. */
+            error = ovsdb_transient_datum_from_json(&datum, &column->type,
+                                                    node->data);
+        } else {
+            error = ovsdb_datum_from_json(&datum, &column->type,
+                                          node->data, NULL);
+        }
         if (error) {
             return error;
         }
-- 
2.40.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to