pcp
[Top] [All Lists]

[bug fix] JSON PMDA instance handling (Was Re: [pcp] pcp update: json pm

To: Mark Goodwin <mgoodwin@xxxxxxxxxx>, "Frank Ch. Eigler" <fche@xxxxxxxxxx>, Mark Goodwin <goodwinos@xxxxxxxxx>
Subject: [bug fix] JSON PMDA instance handling (Was Re: [pcp] pcp update: json pmda)
From: David Smith <dsmith@xxxxxxxxxx>
Date: Tue, 23 Jun 2015 15:12:17 -0500
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5576D75E.2010205@xxxxxxxxxx>
References: <20150609004114.GA9357@xxxxxxxxxx> <557641A2.7040801@xxxxxxxxx> <20150609020038.GB9357@xxxxxxxxxx> <5576D75E.2010205@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
On 06/09/2015 07:09 AM, Mark Goodwin wrote:
> On 06/09/2015 12:00 PM, Frank Ch. Eigler wrote:
>>> the patch itself looks ok to me, but as I read it, this is not just
>>> an err handling issue - if the cache has stale entries then that
>>> suggests the root cause of this issue is in the refresh
>>> functionality - shouldn't it invalidate all entries and then
>>> re-activate only those still current (plus any new instances)?
>>
>> Correcting that latent bug (if it is one) is likely possible as a
>> follow-on.  In the present case, a dynamic data source could have
>> wildly fluctuating sets of instances available from fetch to fetch
>> (e.g., snapshots of recent traffic between source-host network-address
>> pairs, where A-B traffic might appear then disappear then later
>> reappear).  What pmdaCacheOp sequence would you recommend?
> 
> Well, something like this :
> 
> pmdaCacheOp(indom, PMDA_CACHE_INACTIVE);
> refresh indom ...
> for each name in the refreshed instance domain
>     pmdaCacheStore(indom, PMDA_CACHE_ADD, name, ...)

New commit b2b5112ac1c7cc2f07 on the dsmith/dev branch of pcpfans.git
tries to do just that. Please look it over.

-- 
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)

<Prev in Thread] Current Thread [Next in Thread>