Bug 1173376 - system_recipe_map is not being cleared for Aborted/Cancelled recipes
Summary: system_recipe_map is not being cleared for Aborted/Cancelled recipes
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 20.0
Assignee: matt jia
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-12 01:32 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-04-20 02:22:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2014-12-12 01:32:37 UTC
A recipe should only have rows in system_recipe_map while it is still New/Processed/Queued. Once it is Scheduled the rows are removed.

However I am seeing a very large number of rows in system_recipe_map for recipes that are Cancelled or Aborted. I am guessing that we are missing a bit of logic to clear system_recipe_map when a recipe is aborted or cancelled before it reaches Scheduled.

I'm reasonably sure we used to have this so need to double-check that it wasn't intentionally removed to work around some other issue such as db deadlocks (we have some of those still open I think). But either way the current behaviour is not sustainable since the system_recipe_map table will grow unbounded.

On Red Hat's Beaker it is currently at 7 million rows.

Comment 1 Dan Callaghan 2014-12-12 01:38:26 UTC
(In reply to Dan Callaghan from comment #0)
> A recipe should only have rows in system_recipe_map while it is still
> New/Processed/Queued. Once it is Scheduled the rows are removed.

The cleanest solution might be to make update_status() or one of those related methods enforce this invariant.

We will also need to find a way to clean out existing leftover rows from system_recipe_map.

Comment 2 matt jia 2015-02-06 00:45:18 UTC
On gerrit:

  http://gerrit.beaker-project.org/#/c/3967/

Matt Jia

Comment 3 matt jia 2015-02-11 01:42:53 UTC
(In reply to matt jia from comment #2)
> On gerrit:
> 
>   http://gerrit.beaker-project.org/#/c/3967/
> 
> Matt Jia

Have uploaded a new patch:

 http://gerrit.beaker-project.org/#/c/3971/

Matt Jia

Comment 4 matt jia 2015-02-23 04:01:11 UTC
Verify steps:

1. Creat a job

2. cancel it from WEB UI or using bkr job-cancel

3. login to the database and check if rows in the system_recipe_map are cleared

the check sql statement could be sth like this:

select * from system_recipe_map where recipe_id = <any recipe id in your job>

it should return 0 as expected.

Cheers,Matt Jia

Comment 10 Dan Callaghan 2015-04-20 02:22:45 UTC
Beaker 20.0 has been released.


Note You need to log in before you can comment on or make changes to this bug.