summaryrefslogtreecommitdiff
path: root/ovn/ovn-nb.ovsschema
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2015-07-02 17:30:22 -0700
committerBen Pfaff <blp@nicira.com>2015-07-02 17:31:47 -0700
commit445a266a5fe0220088210d556880f2939309d5e0 (patch)
tree15cff89212c48fc69c0f6f299d4ba0e8d98993b7 /ovn/ovn-nb.ovsschema
parentd79ee67fa70b83a3728384062a1d4efe09c53788 (diff)
downloadopenvswitch-445a266a5fe0220088210d556880f2939309d5e0.tar.gz
ovn: Take advantage of OVSDB garbage collection in OVN_Northbound schema.
Until now, the OVN_Northbound schema has been designed to sidestep a weakness in the OVSDB protocol when a column has a great deal of data in it. In the current OVSDB protocol, whenever a column changes, the entire new value of the column is sent to all of the clients that are monitoring that column. That means that adding or removing a small amount of data, say 1 element in a set, requires sending all of the data, which is expensive if the column has a lot of data. One example of a column with potential to have a lot of data is the set of ports within a logical switch, if a logical switch has a large number of ports. Thus, the existing OVN_Northbound schema has each Logical_Port point to its containing Logical_Switch instead of the other way around. This sidesteps the problem because it does not use any large columns. The tradeoff that this forces, however, is that the schema cannot take advantage of OVSDB's garbage collection feature, where it automatically deletes rows that are unreferenced. That's a problem for Neutron because of Neutron-internal races between deletion of a Logical_Switch and creation of new Logical_Ports on the switch being deleted. When such a race happens, OVSDB refuses to delete the Logical_Switch because of references to it from the newly created Logical_Port (although Neutron does delete the pre-existing logical ports). To solve the problem, this commit changes the OVN_Northbound schema to use a set of ports within Logical_Switch. That will lead to large columns for large logical switches; I plan to address that (though I don't have code written) by enhancing the OVSDB protocol. With this commit applied, the database will automatically cascade deleting a logical switch row to delete all of its ports, ACLs, and its router port (if any). This commit makes some pretty pervasive changes to ovn-northd, but they are mostly beneficial to the code readability because now it becomes possible to trivially iterate through the ports that belong to a switch, which was difficult before the schema change. This commit will break the Neutron integration until that is changed to handle the new database schema. CC: Aaron Rosen <arosen@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Russell Bryant <rbryant@redhat.com> Acked-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'ovn/ovn-nb.ovsschema')
-rw-r--r--ovn/ovn-nb.ovsschema39
1 files changed, 25 insertions, 14 deletions
diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index bcbd94b1d..782e0f293 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -4,18 +4,26 @@
"Logical_Switch": {
"columns": {
"name": {"type": "string"},
+ "ports": {"type": {"key": {"type": "uuid",
+ "refTable": "Logical_Port",
+ "refType": "strong"},
+ "min": 0,
+ "max": "unlimited"}},
+ "acls": {"type": {"key": {"type": "uuid",
+ "refTable": "ACL",
+ "refType": "strong"},
+ "min": 0,
+ "max": "unlimited"}},
"router_port": {"type": {"key": {"type": "uuid",
"refTable": "Logical_Router_Port",
"refType": "strong"},
"min": 0, "max": 1}},
"external_ids": {
"type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}}},
+ "min": 0, "max": "unlimited"}}},
+ "isRoot": true},
"Logical_Port": {
"columns": {
- "lswitch": {"type": {"key": {"type": "uuid",
- "refTable": "Logical_Switch",
- "refType": "strong"}}},
"name": {"type": "string"},
"parent_name": {"type": {"key": "string", "min": 0, "max": 1}},
"tag": {
@@ -34,12 +42,10 @@
"external_ids": {
"type": {"key": "string", "value": "string",
"min": 0, "max": "unlimited"}}},
- "indexes": [["name"]]},
+ "indexes": [["name"]],
+ "isRoot": false},
"ACL": {
"columns": {
- "lswitch": {"type": {"key": {"type": "uuid",
- "refTable": "Logical_Switch",
- "refType": "strong"}}},
"priority": {"type": {"key": {"type": "integer",
"minInteger": 1,
"maxInteger": 65535}}},
@@ -49,22 +55,27 @@
"log": {"type": "boolean"},
"external_ids": {
"type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}}},
+ "min": 0, "max": "unlimited"}}},
+ "isRoot": false},
"Logical_Router": {
"columns": {
+ "ports": {"type": {"key": {"type": "uuid",
+ "refTable": "Logical_Router_Port",
+ "refType": "weak"},
+ "min": 0,
+ "max": "unlimited"}},
"ip": {"type": "string"},
"default_gw": {"type": {"key": "string", "min": 0, "max": 1}},
"external_ids": {
"type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}}},
+ "min": 0, "max": "unlimited"}}},
+ "isRoot": true},
"Logical_Router_Port": {
"columns": {
- "router": {"type": {"key": {"type": "uuid",
- "refTable": "Logical_Router",
- "refType": "strong"}}},
"network": {"type": "string"},
"mac": {"type": "string"},
"external_ids": {
"type": {"key": "string", "value": "string",
- "min": 0, "max": "unlimited"}}}}},
+ "min": 0, "max": "unlimited"}}},
+ "isRoot": false}},
"version": "1.0.0"}