Bug 1649047

Summary: Default debug export interval to 1 month instead of 6 and maximum 1000 entries
Product: Red Hat Satellite 6 Reporter: Pavel Moravec <pmoravec>
Component: Tasks PluginAssignee: Lukas Zapletal <lzap>
Status: ASSIGNED --- QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: aruzicka, egolov, ehelms, inecas, lzap
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: https://projects.theforeman.org/issues/25434
Whiteboard:
Fixed In Version: tfm-rubygem-foreman-tasks-0.14.4.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-13 09:20:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Pavel Moravec 2018-11-12 19:00:26 UTC
Description of problem:
In case a Satellite generates many (foreman) tasks per day, foreman-debug will 1) take too long to execute, and 2) generate huge *.csv files. That makes troubleshooting of Satellite issues slower. We shall limit task search in 60-dynflow_debug (only? also? rather?) by number of tasks.

Also from the same rank, tasks cleanup should consider (or at least offer option to) deleting all-except-newest N tasks, instead of time-based filter.

Since I expect there is no one solution that fits all, f-d and cleanup should be ideally bit flexible (i.e. "collect X tasks or tasks from past Y days, whatever is smaller" for f-d and similarly for the cleanup).


Version-Release number of selected component (if applicable):
Sat 6.4


How reproducible:
100%


Steps to Reproduce:
1. Generate too many tasks (i.e. tens of thousands) per day.
2. take foreman-debug
3. run tasks cleanup rake script


Actual results:
2. foreman-debug takes hours to complete, tarball is hundreds of MBs of size, *.csv files (tens of) GBs.
3. still too much tasks kept in db


Expected results:
2. f-d to complete in reasonable time, consuming reasonable disk space
3. only considerable number of tasks remain after the cleanup


Additional info:

Comment 1 Pavel Moravec 2018-11-12 19:08:12 UTC
relevant but imho insufficient: https://projects.theforeman.org/issues/25434

Comment 2 Lukas Zapletal 2018-11-13 09:20:58 UTC
Pavel, please don't create BZ for such a thing, just join our conversation on github. This is indeed a great idea, I will add it to the patch immediately. Will show up in Satellite 6.6 then.

Comment 6 pm-sat@redhat.com 2018-12-17 17:04:58 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25434 has been resolved.

Comment 11 Bryan Kearney 2019-03-19 14:03:21 UTC
Upstream bug assigned to lzap@redhat.com

Comment 12 Lukas Zapletal 2019-03-20 10:26:07 UTC
PR pending: https://projects.theforeman.org/issues/26415

Comment 13 Pavel Moravec 2019-03-27 13:17:23 UTC
FYI this has been updated in sosreport since (future) RHEL7.7.