[ovs-dev] [PATCH] ovsdb-data: Add support for integer ranges in database commands

Łukasz Rząsik lukasz.rzasik at gmail.com
Wed Dec 14 21:39:35 UTC 2016


Hi Ben,

Thank you for looking at the patch.

I was not worrying about this problem because I assumed it was already
there. A user could provide a very long list of integers and this would
affect memory in similar way. There is a limit for how long the list could
get, kernel's limit on size of arguments, so in reality the list would not
get that long but this is outside of OVS control.

Of course with the change it's much easier for a user to specify something
that will explode OVS memory.

I would propose three possible solutions, starting from the easiest and
simplest:
1. Specify an arbitrary limit for size of a range. If a user specifies a
range bigger than the limit, OVS will abort the command and inform the user
about the limit. Actually most of the columns in the database already have
a limit. Quickly looking through the schema I found only one without the
limit: cfm_remote_mpids in Interface table.
2. Internally split very big ranges into smaller ones and commit each range
separately.
3. Create a new struct, e.g. ovsdb_atom_range. Instead of adding every atom
separately to datum, add the struct, send it to the database and handle it
on the database side.

What do you think about it? Maybe I'm missing something? Do you have a
solution in mind?

Thanks,

Lucas

2016-12-13 1:17 GMT+01:00 Ben Pfaff <blp at ovn.org>:

> On Mon, Dec 05, 2016 at 09:47:47PM +0100, Łukasz Rząsik wrote:
> > Adding / removing a range of integers to a column accepting a set of
> > integers requires enumarating all of the integers. This patch simplifies
> > it by introducing 'range' concept to the database commands. Two integers
> > separated by a hyphen represent an inclusive range.
> >
> > The patch adds positive and negative tests for the new syntax.
> > The patch was tested by 'make check'. Covarage was tested by
> > 'make check-lcov'.
> >
> > Signed-off-by: Lukasz Rzasik <lukasz.rzasik at gmail.com>
> > Suggested-by: <my_ovs_discuss at yahoo.com>
> > Suggested-by: Ben Pfaff <blp at ovn.org>
>
> Thanks for contributing to Open vSwitch!
>
> This makes it easy for a user to explode OVS memory requirements.  For
> example, if I just write "1-1000000000", it will use about 16 GB of
> memory in ovs-vsctl (maybe double or triple that!), transfer I guess
> about the same amount of data over the wire, and then write the same
> amount to disk at the database server.  Do you have an idea of how to
> avoid that kind of problem?
>
> Please use 4-space indents consistently.  I see some 2-space indents.
>
> Please use /* */ comments consistently.  I see some // comments.
>
> Thanks,
>
> Ben.
>


More information about the dev mailing list