ovn-org / ovn

Open Virtual Network
Apache License 2.0
508 stars 249 forks source link

ovn-nbctl compiled for database schema 5.30.0 fails when talking to 5.27.0 schema (lr-policy-add) #70

Open mangelajo opened 3 years ago

mangelajo commented 3 years ago
ovn-nbctl --db=tcp:172.17.0.10:6641 lr-policy-add ovn_cluster_router 20000 ip4.dst == 100.2.0.0/16 reroute 169.254.254.1
2021-01-04T16:45:58Z|00002|ovsdb_idl|WARN|Load_Balancer table in OVN_Northbound database lacks options column (database needs upgrade?)
2021-01-04T16:45:58Z|00003|ovsdb_idl|WARN|Logical_Router_Policy table in OVN_Northbound database lacks nexthops column (database needs upgrade?)
2021-01-04T16:45:58Z|00004|ovsdb_idl|WARN|transaction error: {"details":"No column nexthops in table Logical_Router_Policy.","error":"unknown column","syntax":"{\"action\":\"reroute\",\"match\":\"ip4.dst == 100.2.0.0/16\",\"nexthops\":\"169.254.254.1\",\"priority\":20000}"}
ovn-nbctl: transaction error: {"details":"No column nexthops in table Logical_Router_Policy.","error":"unknown column","syntax":"{\"action\":\"reroute\",\"match\":\"ip4.dst == 100.2.0.0/16\",\"nexthops\":\"169.254.254.1\",\"priority\":20000}"}

Would it be possible for ovn-nbctl to detect the DB schema in runtime and use nexthop instead?

@numansiddique ^ ;-)

mangelajo commented 3 years ago

We are finding this on submariner, because we use ovn-nbctl from fedora which is newer than the ovn-kubernetes image. But will suffer of the same issue if somebody uses upstream submariner with openshift's ovn-kubernetes, for example.

numansiddique commented 3 years ago

ovn-nbctl is part of ovn common package and ovn-nb.ovsschema/ovn-sb.ovsschema are part of ovn-central package.

Is it not possible to make sure the same version is used ?

I don't think we have the support in C IDL helper functions (which ovn-nbctl uses) to check if a column is part of the schema or not.

A simple work around is to use ovn-nbctl create command instead of using ovn-nbctl lr-policy-add

Like

ovn-nbctl -- --id=@lrp create Logical_Router_Policy \ match="ip4.dst == 100.2.0.0/16" priority=20000 action=reroute nexthop=169.254.254.1 -- add Logical_Router \ ovn_cluster_router policies @lrp

mangelajo commented 3 years ago

ovn-nbctl is part of ovn common package and ovn-nb.ovsschema/ovn-sb.ovsschema are part of ovn-central package.

Is it not possible to make sure the same version is used ?

Not really, since ovn-kubernetes will be built with a base image we don't know... it could be upstream ovn-kubernetes, or it could be openshift-sdn, or they could be in the process of upgrading the database, etc...

I don't think we have the support in C IDL helper functions (which ovn-nbctl uses) to check if a column is part of the schema or not.

Ack, If you had that you could make ovn-nbctl compatible with version-1, instead of version+1 like now, which is weird :-)

A simple work around is to use ovn-nbctl create command instead of using ovn-nbctl lr-policy-add

Like

ovn-nbctl -- --id=@lrp create Logical_Router_Policy match="ip4.dst == 100.2.0.0/16" priority=20000 action=reroute nexthop=169.254.254.1 -- add Logical_Router ovn_cluster_router policies @lrp

+1 That will help I hadn't thought of that option :-) thank you.