[Top] [All Lists]

Re: [pcp] PMNS scope globality

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: [pcp] PMNS scope globality
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 05 Apr 2012 10:06:38 +1000
Cc: pcp developers <pcp@xxxxxxxxxxx>
In-reply-to: <20120404202551.GA29020@xxxxxxxxxx>
References: <20120404202551.GA29020@xxxxxxxxxx>
On Wed, 2012-04-04 at 16:25 -0400, Frank Ch. Eigler wrote:
> Hi -
> Can someone explain how come PMNS data is stored in libpcp on a
> per-process basis (in libpcp/src/pmns.c:curr_pmns) rather than
> per-context?  Does this not make it impossible to operate with
> different PMNS setups with different contexts, e.g. if one makes one
> connection to a remote server, and another to a local archive-v2 file?

OK Frank, brace yourself for some ancient history ...

In current versions of the protocols (aka with the distributed
namespace), for live use the only person to load the PMNS is pmcd and
pmcd is single-threaded and pmcd presents the _same_ PMNS to all clients
irrespective of the context they are using ... this one PMNS is loaded
and reloaded into the address space of pmcd as PMDAs come and go.

If a client calls pmLoadNameSpace (this is the old style and generally
does not happen these days outside QA), then there is a single PMNS that
is loaded and this is used for _all_ non-archive contexts ... so very
bizarre results may happen if you use more than one host context and
call pmLoadNameSpace() ... unless all the hosts have the same real

If the client does not call pmLoadNameSpace() and uses a local context
then the default PMNS is loaded when the context is created using the
same logic as the old style, i.e. the one global PMNS is setup for the
local context.

For an archive context there is one PMNS per archive (accessed via
ctxp->c_archctl->ac_log->l_pmns) ... this PMNS comes from the metadata
in the archive.

As a result curr_pmns is serving multiple purposes
- _the_ PMNS for pmcd
- _the_ PMNS for local contexts
- _the_ PMNS for all host contexts if pmLoadNameSpace() is explicitly

So the scenario you foreshadow does work ... with one PMNS from each the
remote pmcd context (in pmcd) and one PMNS for each archive context (in
the client).

I know this is a convoluted answer, the short verion is that for all
"normal" (tm) uses, there is one PMNS per context.

Hope this helps ... 8^)>

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