Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-12 Thread Aaron Rosen
Hi, I believe I've addressed the corner case in this patch set by returning a dict() that represents the current state of the database on connection reset/initial sync, otherwise a list of changes. This should allow the user to have a consistent view of the database. I've also changed the response

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-12 Thread Reid Price
I am also a bit concerned by issues that might arise from a user thinking that this is always accurate, rather than hints. Aaron, I think you had said something regarding this when we chatted off-list, but I don't recall the details. -Reid On Fri, Aug 9, 2013 at 2:50 PM, Reid Price wrote: >

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-12 Thread Ben Pfaff
This is pretty crude (nothing else in the IDL interface requires the caller to understand the JSON-RPC protocol) and seems difficult for the callers to use. The changes that it returns can also be incomplete, at least in one corner case: if the database connection drops and reconnects, then the re

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-12 Thread Aaron Rosen
On Fri, Aug 9, 2013 at 2:50 PM, Reid Price wrote: > Or you could keep the original function behavior the same and expose this > as a separate function > > def foo(...): > > > def run(...): > return self.foo(...)[0] > > where foo is a better function name - update? run_details? > run

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-09 Thread Reid Price
Or you could keep the original function behavior the same and expose this as a separate function def foo(...): def run(...): return self.foo(...)[0] where foo is a better function name - update? run_details? run_with_changes? run_diff? _run? No opinion there. -Reid On Fri, Au

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-09 Thread Aaron Rosen
Right, this would break things for anyone checking the return value of idl.run(). The only alternative I see to that is if we pass an optional arg to run() (i.e: def run(self, return_changes=False)). Would you prefer this instead? Thanks, Aaron On Fri, Aug 9, 2013 at 1:02 PM, Ben Pfaff wrote:

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-09 Thread Ben Pfaff
On Tue, Aug 06, 2013 at 02:45:35PM -0700, Aaron Rosen wrote: > This patch changes what is being returned from Idl.run() to a tuple > (changed, changes) so one can determine what changes have occurred to > the database without having to read the entire table. > > Signed-off-by: Aaron Rosen It see

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-07 Thread Paul Ingram
NVPd also calls idl.run() :: psi On Aug 7, 2013, at 1:37 PM, Reid Price wrote: > I like this one better. I am surprised that test-ovsdb has the only > invocations of idl.run(), but if that is true, LGTM. > > > On Tue, Aug 6, 2013 at 3:14 PM, Aaron Rosen wrote: > This patch changes what is

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-07 Thread Reid Price
I like this one better. I am surprised that test-ovsdb has the only invocations of idl.run(), but if that is true, LGTM. On Tue, Aug 6, 2013 at 3:14 PM, Aaron Rosen wrote: > This patch changes what is being returned from Idl.run() to a tuple > (changed, changes) so one can determine what chang

Re: [ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-06 Thread Aaron Rosen
This patch changes what is being returned from Idl.run() to a tuple (changed, changes) so one can determine what changes have occurred to the database without having to read the entire table. Signed-off-by: Aaron Rosen --- python/ovs/db/idl.py | 16 ++-- tests/test-ovsdb.py |4

[ovs-dev] [PATCH] Adds way to determine db changes from Idl.run()

2013-08-06 Thread Aaron Rosen
This patch changes what is being returned from Idl.run() to a tuple (changed, changes) so one can determine what changes have occurred to the database without having to read the entire table. Signed-off-by: Aaron Rosen --- python/ovs/db/idl.py | 16 ++-- tests/test-ovsdb.py |4