Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce purge timer for drift states #13086

Merged
merged 1 commit into from
Dec 13, 2016

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Dec 9, 2016

This schedules purging drift states

This is contintinuing the trend of #13044 that is addressing

https://bugzilla.redhat.com/show_bug.cgi?id=1348625

Fixes #11868

numbers

in my test, purging 116,576 drift states (with default 10k batch sizes) takes 9 seconds

@@ -182,6 +182,12 @@ def schedules_for_scheduler_role
enqueue :storage_authentication_check_schedule
end

# Schedule - Prune old reports Timer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -105,6 +105,10 @@ def metric_purging_purge_rollup_timer
queue_work(:class_name => "Metric::Purging", :method_name => "purge_rollup_timer", :zone => nil)
end

def drift_state_purge_timer
queue_work(:class_name => "DriftState", :method_name => "purge_timer", :zone => nil)
Copy link
Member

@jrafanie jrafanie Dec 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default "age" of drift states that it will purge?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made that up. if you have something else, let me know

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking once a day seems reasonable.

@miq-bot
Copy link
Member

miq-bot commented Dec 9, 2016

Checked commit kbrock@f84a425 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
2 files checked, 0 offenses detected
Everything looks good. 👍

@@ -182,6 +182,11 @@ def schedules_for_scheduler_role
enqueue :storage_authentication_check_schedule
end

every = worker_setting_or_default(:drift_state_purge_interval, 1.day)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yrudman FYI, here is another place that I think you can kill defaults and rely on the settings.yml. worker_setting_or_default was written to encode defaults in case the key doesn't exist, but with the new config it always will.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. this has outlived its usefulness

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will look at it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR: #13157

@Fryguy
Copy link
Member

Fryguy commented Dec 9, 2016

LGTM 👍

@Fryguy Fryguy merged commit f638c97 into ManageIQ:master Dec 13, 2016
@Fryguy Fryguy added this to the Sprint 51 Ending Jan 2, 2017 milestone Dec 13, 2016
@kbrock kbrock deleted the purge_performance_states branch December 13, 2016 20:56
simaishi pushed a commit that referenced this pull request Jan 9, 2017
@simaishi
Copy link
Contributor

simaishi commented Jan 9, 2017

Euwe backport details:

$ git log -1
commit 892ac79a18813457b9adafe2a44946f84fe0bc6f
Author: Jason Frey <fryguy9@gmail.com>
Date:   Tue Dec 13 13:53:27 2016 -0500

    Merge pull request #13086 from kbrock/purge_performance_states
    
    Introduce purge timer for drift states
    (cherry picked from commit f638c97c38ce2dc405641d7921432b99585e5772)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1410846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants