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

Numan Siddique numans at ovn.org
Wed Jan 22 07:49:22 UTC 2020


On Wed, Jan 22, 2020 at 7:07 AM Dhathri Purohith
<dhathri.purohith at nutanix.com> wrote:
>
> Hi All,
>
>
>
> I had previously posted this query on ovs-dev mailing list, but realized that was not the right mailing list.
>
> Re-posting the query here again for better visibility.
>
>
>
> 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?

Hi Dhathri,

We always try to be backward compatible.

I think it is better to support both the types.  We can probably add a
new type called "hostname" (or a better name)
which can take both IPv4 address and string with quotes. If other dhcp
options like dns_server etc also take hostnames,
we can support that quite easily.

The only DB change would be - is to add a new enum entry for the
"type" column in the DHCP_Options table in SB DB.
And I think this will be backward compatible.

We can also address by adding a new DHCP option - tftp_server_hostname
(or may be a better name) of type string.
CMS can decide to use appropriate options depending on the actual
value. For this we need to add a new option in lib/ovn-l7.h.
I would prefer what you suggested.

What do you think ?

Thanks
Numan






>
>
>
> Thanks,
>
> Dhathri
>
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


More information about the discuss mailing list