Bug 1574311

Summary: beakerd update_dirty_job() loads all power commands for no reason when releasing a system
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: schedulerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dcallagh, mtyson, rjoost
Target Milestone: 25.3Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-18 00:52:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1097861    

Description Dan Callaghan 2018-05-03 04:53:48 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1097861#c37

There should be no reason it needs to do that expensive SELECT. It adds about 4 seconds to each call in our prod environment which adds up to a lot.

Comment 1 Dan Callaghan 2018-05-03 05:06:53 UTC
Oops, this was the system releasing code path in update_dirty_job(), not provision_scheduled_recipe().

Comment 2 Dan Callaghan 2018-05-03 06:02:28 UTC
https://gerrit.beaker-project.org/6091

Also fixed this while I was in there (although it's unrelated):

https://gerrit.beaker-project.org/6092

Comment 3 Dan Callaghan 2018-05-03 06:57:27 UTC
Okay so there *is* the same problem in provision_scheduled_recipe() also, and that's because it is ultimately the same code system.enqueue_command() which was needlessly SELECT'ing out the commands before inserting. So the patch above fixes the same problem in both places.