[ovs-dev] Update data-type of a column in OVN-SB

Dhathri Purohith dhathri.purohith at nutanix.com
Wed Jan 8 21:59:04 UTC 2020


Hi,



We have a requirement to update the datatype of a column in OVN-SB. However, this is not straight-forward.

There could be existing entries in the database that has the old type and hence the change will not be backward compatible.



Here is the reason for this requirement -

According to RFC 2132 (https://tools.ietf.org/html/rfc2132) , section 9.4, DHCP option 66 (tftp_server) can be hostname.

Current OVN implementation requires DHCP Option 66 (tftp_server) to be of type “ipv4”, which is restrictive and does not conform to the RFC.

Hence, we want to change the type for DHCP option 66 (tftp_server) to “str” instead of “ipv4”.

When we make this change, we need a way to convert the existing entries in the DB to “str” from “ipv4”, else the parser will complain.

For eg., consider an entry such as this in the DB –

options             : {dns_server="{8.8.8.8, 9.9.9.9}", domain_name="\"dom.com\"", lease_time="43200", mtu="1442", router="50.0.0.1", server_id="50.0.0.1", server_mac="aa:bb:cc:dd:00:11", tftp_server="4.4.4.4"}

Since the parser is now expecting a “str” for “tftp_server”, it complains while parsing this option. Instead we need to have an entry like this (note the quotes for the option) –

options             : {dns_server="{8.8.8.8, 9.9.9.9}", domain_name="\"dom.com\"", lease_time="43200", mtu="1442", router="50.0.0.1", server_id="50.0.0.1", server_mac="aa:bb:cc:dd:00:11", tftp_server="\"4.4.4.4\""}



Another alternative might be to support both types for this option. For this, we can return a list from “gen_opts_find()” function and enhance the parser code to support multiple types.



Are there any guidelines or suggestions to make a schema change such as this?

Thanks,
Dhathri


More information about the dev mailing list