Merge lp:~allenap/maas/power-poll-fewer--bug-1389007 into lp:maas/trunk

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 3420
Merged at revision: 4076
Proposed branch: lp:~allenap/maas/power-poll-fewer--bug-1389007
Merge into: lp:maas/trunk
Diff against target: 1586 lines (+998/-184)
16 files modified
HACKING.txt (+9/-3)
src/maasserver/migrations/ (+515/-0)
src/maasserver/models/ (+13/-3)
src/maasserver/models/tests/ (+8/-0)
src/maasserver/models/ (+1/-0)
src/maasserver/rpc/ (+88/-22)
src/maasserver/rpc/tests/ (+133/-22)
src/maasserver/rpc/tests/ (+9/-2)
src/maasserver/testing/ (+23/-9)
src/maasserver/websockets/handlers/ (+1/-0)
src/maasserver/websockets/handlers/ (+3/-0)
src/provisioningserver/pserv_services/ (+31/-39)
src/provisioningserver/pserv_services/tests/ (+35/-47)
src/provisioningserver/rpc/ (+45/-32)
src/provisioningserver/rpc/ (+10/-5)
src/provisioningserver/rpc/tests/ (+74/-0)
To merge this branch: bzr merge lp:~allenap/maas/power-poll-fewer--bug-1389007
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email:

This proposal supersedes a proposal from 2014-11-24.

Commit message

Query node power states in smaller batches.

Description of the change

Big diff because migrations!

This branch was previously reviewed by Graham Binns, and approved. It
has changed only a little since then, but I'd appreciate a sanity check
before I land it.

This branch adds a power_state_updated field to Node, which records when
the power state was last checked, regardless of success or failure. It's
a simple way to rate-limit checks.

The reason it's needed is because ListNodePowerParameters now only
returns a subset of all queryable nodes (at least for a large
installation). Each time it's called it returns a list of those nodes
that need checking *in priority order*. Nodes that have never had their
power state checked are done first, then the ones that have been queried
least recently.

We /could/ later use this new field to trigger an immediate check via
the API or UI; set it to NULL and it'll be in the next set of checks.
That's a bit of an abuse though.

In any case, this branch is meant to be a most-bang-for-the-least-buck
kind of thing. It doesn't back us into a corner, but does solve the
immediate problem in what I hope is an elegant and effective way.


To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote : Posted in a previous version of this proposal

LGTM. I have some questions and concerns, but nothing to hold the branch back.

review: Approve
Revision history for this message
Gavin Panella (allenap) wrote : Posted in a previous version of this proposal

Ta muchly!

Revision history for this message
MAAS Lander (maas-lander) wrote : Posted in a previous version of this proposal
Download full text (4.6 MiB)

The attempt to merge lp:~allenap/maas/power-poll-fewer--bug-1389007 into lp:maas failed. Below is the output from the failed tests.

Ign trusty-security InRelease
Get:1 trusty-security Release.gpg [933 B]
Ign trusty InRelease
Get:2 trusty-security Release [62.0 kB]
Ign trusty-updates InRelease
Hit trusty Release.gpg
Get:3 trusty-updates Release.gpg [933 B]
Hit trusty Release
Get:4 trusty-updates Release [62.0 kB]
Get:5 trusty-security/main Sources [51.5 kB]
Hit trusty/main Sources
Get:6 trusty-security/universe Sources [17.4 kB]
Get:7 trusty-security/main amd64 Packages [162 kB]
Get:8 trusty-security/universe amd64 Packages [72.6 kB]
Hit trusty-security/main Translation-en
Hit trusty/universe Sources
Hit trusty-security/universe Translation-en
Hit trusty/main amd64 Packages
Hit trusty/universe amd64 Packages
Hit trusty/main Translation-en
Hit trusty/universe Translation-en
Get:9 trusty-updates/main Sources [142 kB]
Get:10 trusty-updates/universe Sources [91.8 kB]
Get:11 trusty-updates/main amd64 Packages [367 kB]
Get:12 trusty-updates/universe amd64 Packages [220 kB]
Hit trusty-updates/main Translation-en
Hit trusty-updates/universe Translation-en
Ign trusty/main Translation-en_US
Ign trusty/universe Translation-en_US
Fetched 1,250 kB in 2s (437 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools gjs ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make pep8 postgresql pyflakes python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-mimeparse python-mock python-netaddr python-netifaces python-nose python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi ...