[ovs-dev] [PATCH V6] Add Passive TCP connection to IDL.

Ofer Ben-Yacov ofer.benyacov at gmail.com
Mon Mar 28 06:25:51 UTC 2016


Hi Ben,

I understand that you met Ayal for a short talk during ONS.
>From what he told me I think there might be some misunderstanding so I
would like to make it clear what the intent here is.
First, in case I did not explain it clearly before, I do *not* mean that
the right sequence is "connect -> disconnect -> connect".
I completely agree with you that we should connect only once and the code
does exactly that.
In my opinion, the only point that we need to agree upon is how to get the
schema.
What the patch does right now is open the connection once, retrieve the
schema and continue to work using the same connection.

I think the point of disagreement here is about whether we should maintain
a local copy of the schema or not.
Since we want to retrieve the *entire* schema, we do not need to keep a
copy of it locally. To validate that the schema hasn't changed, we just
need to verify that the schema version hasn't changed.

Does this make sense?

BR,
Ofer



On Tue, Mar 8, 2016 at 8:41 AM Ofer Ben-Yacov <ofer.benyacov at gmail.com>
wrote:

> Hi Ben,
>
> I'm still waiting for you response.
> Do you see the reason for the current usage of IDL, where Neutron and my
> patch get the schema from the server, or do you insist that the schema will
> be read from a file?
>
> I do think that if Neutron is using is like that and I took this approach
> too than it is probably feature that is needed and IDL should support it. I
> would go even further and add the ability to get the schema from the server
> into SchemaHelper or IDL instead of reading it outside of these classes and
> send it in, like Neutron does.
>
> Regards,
> Ofer.
>
>
>
>
>
>
> ‫בתאריך יום ד׳, 2 במרץ 2016 ב-9:47 מאת ‪Ofer Ben-Yacov‬‏ <‪
> ofer.benyacov at gmail.com‬‏>:‬
>
>> Actually, SchemaHelper supports both ways: getting the schema from the
>> server or read it from file (schema_json / location parameters). Neutron
>> took the first approach probably because they wanted all the tables
>> anyway.
>>
>>
>> If we want to keep supporting getting the schema from the server, than my
>> change of sending the open stream to IDL is a must.
>> If you want to have the file option only (even if it is currently coded
>> differently), than I will change the patch to support only getting the
>> schema form a file.
>>
>>
>> Ofer.
>>
>>
>> ‫בתאריך יום ב׳, 29 בפבר׳ 2016 ב-19:58 מאת ‪Ben Pfaff‬‏ <‪blp at ovn.org‬‏>:‬
>>
>>> That's not how the Python version of the IDL is meant to be used.
>>> SchemaHelper operates on the schema that the client *wants*, not on the
>>> schema that the database server *has*.  That's why it reads the schema
>>> from a local disk file by default.  If Neutron does something else then
>>> it should probably be changed.
>>>
>>> On Mon, Feb 29, 2016 at 08:06:33AM +0000, Ofer Ben-Yacov wrote:
>>> > Take a loot at the contractor of IDL:
>>> >
>>> > ...
>>> > def __init__(self, remote, schema):
>>> > ...
>>> >
>>> >
>>> > You can see that it gets schema as a parameter, which is actually
>>> > SchemaHelper object:
>>> >
>>> > ...
>>> > assert isinstance(schema, SchemaHelper)
>>> > ...
>>> >
>>> >
>>> > This object holds the schema in a json string (schema_json) until you
>>> will
>>> > call its register_columns function which will build the tables.
>>> >
>>> > You can see that the IDL, when first built, is getting the schema which
>>> > means that the OVSDB server was already connected beforehand to get it.
>>> >
>>> > If you should like to know how this is done, you can look at Neutron's
>>> > idlutils.py file and check the get_schema_helper() function.
>>> >
>>> > You can see that it gets the schema name as a parameter, connects to
>>> the
>>> > OVSDB, get the schema, close the connection and
>>> > return SchemaHelper object to be used for the above.
>>> >
>>> >
>>> > Note that after this patch will be committed, I'm going to send a
>>> patch to
>>> > Neutron to add another function similar to get_schema_helper() with the
>>> > the deference that it will get stream (open connection to the OVSDB
>>> server)
>>> > as a parameter and get the schema from the server without closing it
>>> when
>>> > done.
>>> >
>>> > Ofer.
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > ‫בתאריך שבת, 27 בפבר׳ 2016 ב-3:13 מאת ‪Ben Pfaff‬‏ <‪blp at ovn.org‬‏>:‬
>>> >
>>> > > On Wed, Feb 24, 2016 at 08:39:02AM +0000, Ofer Ben-Yacov wrote:
>>> > > > The current implementation IDL is:
>>> > > > 1. connects to the OVSDB
>>> > > > 2. get the schema and
>>> > > > 3. disconnect
>>> > > > 4. connect again to work with the OVSDB server.
>>> > >
>>> > > I don't understand--where do you see that behavior?  I can't spot it
>>> > > anywhere.  The code I see in python/ovs/db/idl.py doesn't seem to do
>>> > > anything like it.
>>> > >
>>>
>>



More information about the dev mailing list