[pcp] pmda instance cache operations
kenj at internode.on.net
Sun Jan 24 16:39:56 CST 2010
OK, there are NO checks in the code at the moment!
So, what do you think the correct outcome should be?
a) second pmdaCacheOp(indom, PMDA_CACHE_LOAD) returns an error?
b) pmdaCacheOp(indom, PMDA_CACHE_LOAD) fails if anything already in the
c) purge cache first then load, so 2 inactive instances?
d) cache state wins if loaded instance already in cache?
I'd vote for b) which is a very similar to a), but a little easier to
explain and deals with the more subtle no load, store an instance, then
try to load flawed logic.
On Mon, 2010-01-25 at 08:53 +1100, Max Matveev wrote:
> On Mon, 25 Jan 2010 07:34:42 +1100, Ken McDonell wrote:
> kenj> Max,
> kenj> I'd expect 2 entries (assuming the initial PMDA_CACHE_LOAD loads
> kenj> nothing), and both of these should be inactive.
> kenj> As the man page says ...
> kenj> This operation loads the cache from the external file, and then
> kenj> all cache entries are marked inactive, and the additional data
> kenj> pointer is set to NULL. Consequently, a PMDA is only likely to
> kenj> perform this operation once per execution.
> kenj> What are you seeing?
> I'm seeing 4 entries: 2 active, 2 inactive, one for each instance ID,
> i.e 0 (ook) active and inactive, 1 (eek) active and inactive.
> kenj> Is there some reason you need to call PMDA_CACHE_LOAD a second time?
> It was a bug in my code, I did not want to do that but it could be
> considered that other people may.
More information about the pcp