On Wed, Oct 30, 2013 at 9:26 AM, Gustavo Niemeyer <gust...@niemeyer.net>wrote:

> On Wed, Oct 30, 2013 at 7:57 AM, John Arbash Meinel
> <j...@arbash-meinel.com> wrote:
> >> Where is N^2 coming from?
> >
> > If you add N units one-by-one each new add triggers all existing units
> > to wake up and ask for the Life and CharmURL of the service again. So
> > first unit asks, 2nd unit asks and causes the first unit to ask again.
>
> Why does it cause the first unit to ask again?  Adding a unit should
> not trigger watchers on the service to wake up. There are explicit
> watches for being notified about new units.
>

The service watch fires on any change to the document, and adding a unit
increments the service's unitcount field. The easy fix is to wrap the
service watcher so that it discards irrelevant changes; the hard fix
(schema change!) is to move the refcounts into their own docs, as we do
elsewhere in state.
-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to