-
Notifications
You must be signed in to change notification settings - Fork 289
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
Fixes #28656 - Store DMI UUID on Subscription Facet #8489
Conversation
Issues: #28656 |
@@ -96,16 +94,6 @@ def test_existing_host_null_uuid | |||
|
|||
assert @klass.validate_hosts(hosts, @org, @host.name, 'different-uuid') | |||
end | |||
|
|||
def test_existing_uuid_mismatch_unregistered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case is irrelevant b/c facts are now destroyed during unregister
@@ -297,7 +298,7 @@ def remove_host_artifacts(host, clear_content_facet = true) | |||
host.get_status(::Katello::TraceStatus).destroy | |||
host.installed_packages.delete_all | |||
|
|||
host.rhsm_fact_values.destroy_all | |||
host.rhsm_fact_values.delete_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind reverting this, but thought it was simple enough to include. Changed to delete_all
since we aren't concerned with the values that are destroyed
Couple of things
|
Fair point but I want to find some examples to make sure that's what we typically do before moving it to the migration
+1 (if we don't move to the migration) |
https://github.com/Katello/katello/blob/master/db/migrate/20150930183738_migrate_content_hosts.rb |
Sounds like separate rake task is more beneficial longer term. Just add a test for that rake task |
1df8096
to
c98ee30
Compare
@parthaa updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked the performance improvements, almost 8 times faster for me. ACK
[test katello] |
Not so long ago the DMI UUID (reported by subman) of Content Hosts became critical to the registration process in order to block duplicate host registrations. The value is stored among the system facts, and looking up duplicates at registration time in a very large table can become slow as the number of hosts grow.
This PR helps alleviate the problem by making the DMI UUID a value on the SubscriptionFacet model. The below performance measures are taken from 1000 content hosts each with a distinct DMI UUID fact.
Old query performance
New query performance:
Looks like the duplicate lookup is 5x faster.
To test
checkout PR
migrate the DB
run the rake task to populate subscription facet:
bundle exec rake katello:upgrades:3.15:set_sub_facet_dmi_uuid
Registrations should exhibit all of the same behaviors w.r.t preventing duplicate hosts by DMI UUID.
Changing the DMI UUID from the client side via fact override should also update the subscription facet field