Merge lp:~allenap/maas/fewer-power-params-per-batch into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Andres Rodriguez |
Approved revision: | no longer in the source branch. |
Merged at revision: | 5948 |
Proposed branch: | lp:~allenap/maas/fewer-power-params-per-batch |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
148 lines (+51/-5) 4 files modified
src/maasserver/rpc/nodes.py (+10/-2) src/maasserver/rpc/tests/test_nodes.py (+24/-3) src/maasserver/testing/factory.py (+1/-0) src/maasserver/testing/tests/test_factory.py (+16/-0) |
To merge this branch: | bzr merge lp:~allenap/maas/fewer-power-params-per-batch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andres Rodriguez (community) | Approve | ||
Review via email: mp+322089@code.launchpad.net |
Commit message
Limit batches of node power parameters to 10 for the periodic power checking service.
This is intended to reduce the likelihood of transactional conflicts.
Description of the change
When each batch of node power parameters is fetched from the region by a rack's power monitor service there is a sting in the tail: every row in maasserver_node that corresponds to those parameters is updated. This appears to be increasing transactional conflicts in the database to the point where it exceeds 10 retries and the transaction is fully rejected.
A better way to fix this would be to not update those rows, or to have a separate table to record last-queried times, but that's a lot more work and there isn't time right now, so instead we limit the batch size to 10.
This also fixes a long-standing bug in Factory.make_Node where the given power parameters were being ignored when also using bmc_connected_to. This fix improves the speed of one particular test, taking it from ~15 seconds to <1 second.
lgtm! Should this be attached to the bug report ?