pcp
[Top] [All Lists]

Re: [pcp] pmda instance cache operations

To: Max Matveev <makc@xxxxxxxxx>
Subject: Re: [pcp] pmda instance cache operations
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Mon, 25 Jan 2010 09:39:56 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <19292.49501.402549.217702@xxxxxxxxxxxx>
References: <19292.18578.486513.899049@xxxxxxxxxxxx> <1264365282.5401.3.camel@xxxxxxxxxxxxxxxx> <19292.49501.402549.217702@xxxxxxxxxxxx>
Reply-to: kenj@xxxxxxxxxxxxxxxx
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
cache?
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.
> 
> max


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