[ovs-dev] [PATCH] ovsdb: separate json cache for different monitor versions

Han Zhou zhouhan at gmail.com
Fri Dec 18 02:46:23 UTC 2015


On Thu, Dec 17, 2015 at 4:33 PM, Han Zhou <zhouhan at gmail.com> wrote:

> Hi Andy,
>
> Thanks for your review.
>
>
> On Thu, Dec 17, 2015 at 2:00 PM, Andy Zhou <azhou at ovn.org> wrote:
>
>>
>>
>> On Tue, Dec 15, 2015 at 7:06 PM, Han Zhou <zhouhan at gmail.com> wrote:
>>
>>> Cached json objects were reused when sending notifications to
>>> clients. This created a problem when there were different versions
>>> of monitors coexiting. E.g. clients expecting version2 notification
>>> would receive messages with method == "update2" but payload in
>>> version1 format, which end up failure of processing the updates.
>>>
>>> This patch fixes the issue by using dedicated cache for each version.
>>>
>>>
>> Is it really necessary to have json cache array? How about extending
>> ovsdb_monitor_json_cache_node to also include version, than multiples
>> versions
>> of json_object can co-exist in a single cache.  What do you think?
>>
>>
> Well this could be an alternative solution. Since dbmon doesn't know which
> versions of objects will be required later at the moment when the cache
> node is being constructed, what we can do is to compose the object only for
> the version of the first jsonrpc_monitor, and when a new version of
> jsonrpc_monitor comes, compose for the new version.
> That means we will need to redefine the search function as "search and
> then check the version in the node", and redefine the insert function as
> "search and then update for new version (if hash node not found, create new
> node)".
>
> This should work but I am not sure if there is strong benefit compare to
> the current patch which seems to be more straightforward. What do you think?
>
>
Sorry that I misunderstood your comment. I thought in a more complex way :(
I will provide v2 based on your suggestion. Thanks!

Han
-- 
Best regards,
Han



More information about the dev mailing list