[Xorp-hackers] FEA: Difference in _live_config v/s _pulled_config
pavlin at ICSI.Berkeley.EDU
Thu Mar 20 09:48:22 PDT 2008
Ben Greear <greearb at candelatech.com> wrote:
> Pavlin Radoslavov wrote:
> > Ben Greear <greearb at candelatech.com> wrote:
> >> It seems to me that these two have significant overlap in
> >> meaning and perhaps could be consolidated?
> >> Why do we have both of them?
> > Conceptually they are populated using different mechanisms, but
> > pragmatically they should contain same information.
> > The _live_config IfTree is populated/updated asynchronously by the
> > IfConfig Observer that tracks the kernel upcalls.
> > The _pulled_config is populated on demand (explicitly) by the
> > pull_config() method.
> > In other words, _live_config is a moving target, while
> > _pulled_config is a snapshot.
> I merged these, and it seems to work fine. Eventually, that might be a
> good way
> to get rid of some many pull_config() calls as well. I can't think of
> any reason why
> we'd ever *want* pulled_config to get stale, so letting observer update
> it seems
> valid. Maybe I'm missing something?
At the high level, _pulled_config is used for synchronous purpose,
while the _live_config is used for asyncronous purpose.
However, just can't just get rid of pulled_config:
* The Observer mechanism doesn't always exist (e.g., Windows).
* In some cases (like when committing the interface
configuration), in the middle of the commit we need to
synchronously pull the interface configuration from the kernel
(e.g., to fill-in kernel generated information such as the
physical interface index).
The Observer is asynchronous so we can't use it for the synchronous
population of _pull_config.
Hope that helps,
More information about the Xorp-hackers