New commit detected on ManageIQ/manageiq/gaprindashvili:
Author: Keenan Brock <email@example.com>
AuthorDate: Thu Aug 2 11:02:37 2018 -0400
Commit: Keenan Brock <firstname.lastname@example.org>
CommitDate: Thu Aug 2 11:02:37 2018 -0400
Merge pull request #17727 from yrudman/purge-old-jobs-and-tasks
Purge old MiqTasks and associated records
(cherry picked from commit 98497e92f886a3cd0fef712214674cca997d3101)
app/models/miq_schedule_worker/jobs.rb | 4 +
app/models/miq_schedule_worker/runner.rb | 5 +
app/models/miq_task.rb | 2 +
app/models/miq_task/purging.rb | 26 +
config/settings.yml | 5 +
spec/models/miq_task/purging_spec.rb | 50 +
6 files changed, 92 insertions(+)
New commit detected on ManageIQ/manageiq-schema/gaprindashvili:
Author: Jason Frey <email@example.com>
AuthorDate: Tue Aug 7 12:26:31 2018 -0400
Commit: Jason Frey <firstname.lastname@example.org>
CommitDate: Tue Aug 7 12:26:31 2018 -0400
Merge pull request #201 from yrudman/delete-old-job-while-creating-linked-task
Optimize migration which creates task for each job
(cherry picked from commit 8d48f1bedf9c42661ecb83ae3ab5ab9fb2b21545)
db/migrate/20170120164058_create_task_for_each_job_and_transfer_attributes.rb | 22 +
spec/migrations/20170120164058_create_task_for_each_job_and_transfer_attributes_spec.rb | 32 +
2 files changed, 54 insertions(+)
With 1000 jobs the difference is negligible when migrating from
126.96.36.199-1 to cfme-188.8.131.52-1.el7cf.x86_64
184.108.40.206-1 to cfme-220.127.116.11-1.el7cf.x86_64
yes, it is negligible with 1000, real improvement will be on millions records...
(In reply to Yuri Rudman from comment #5)
> yes, it is negligible with 1000, real improvement will be on millions
Just creating 1M of records takes about 8 hours.
After this was done I did try the migration to older version (cfme-18.104.22.168-1.el7cf.x86_64). The db:migrate task takes more than 3min, the output stopped at:
== 20170120154842 AddStartedOnColumnToMiqTasks: migrating =====================
-- add_column(:miq_tasks, :started_on, :datetime)
-- add_column(:miq_tasks, :zone, :string)
== 20170120154842 AddStartedOnColumnToMiqTasks: migrated (0.0126s) ============
== 20170120164058 CreateTaskForEachJobAndTransferAttributes: migrating ========
-- Creating tasks associated with jobs
While the fixed verson is done in 0m 44s.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.