<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="purple">
<div class="WordSection1">
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">Hi All,</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"> <o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt">I had previously posted this query on ovs-dev mailing list, but realized that was not the right mailing list.<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt">Re-posting the query here again for better visibility.
<o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">We have a requirement to update the datatype of a column in OVN-SB. However, this is not straight-forward.
</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">There could be existing entries in the database that has the old type and hence the change will not be backward compatible.</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">Here is the reason for this requirement -</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">According to RFC 2132 (<a href="https://tools.ietf.org/html/rfc2132">https://tools.ietf.org/html/rfc2132</a>) , section 9.4, DHCP option 66 (tftp_server) can be hostname.</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">Current OVN implementation requires DHCP Option 66 (tftp_server) to be of type “ipv4”, which is restrictive and does not conform to the RFC.</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">Hence, we want to change the type for DHCP option 66 (tftp_server) to “str” instead of “ipv4”.
</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">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.</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">For eg., consider an entry such as this in the DB –
</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt;font-family:"Courier New"">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", <b><span style="color:#C00000">tftp_server="4.4.4.4"</span></b><span style="color:black">}</span></span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">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) –</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt;font-family:"Courier New"">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", <b><span style="color:#C00000">tftp_server="\"4.4.4.4\""</span></b><span style="color:black">}</span></span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">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.</span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p style="margin:0in;margin-bottom:.0001pt"><span style="font-size:12.0pt">Are there any guidelines or suggestions to make a schema change such as this?</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Dhathri<o:p></o:p></p>
</div>
</body>
</html>