Bug 785170 - Possible duplicate and unneeded entitlement regenerations on import
Possible duplicate and unneeded entitlement regenerations on import
Status: CLOSED CURRENTRELEASE
Product: Subscription Asset Manager
Classification: Red Hat
Component: candlepin (Show other bugs)
1.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Alex Wood
Tazim Kolhar
: Triaged
Depends On:
Blocks: sam12-tracker
  Show dependency treegraph
 
Reported: 2012-01-27 09:11 EST by James Bowes
Modified: 2016-04-25 20:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-07 13:19:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
tkolhar: needinfo+


Attachments (Terms of Use)

  None (edit)
Description James Bowes 2012-01-27 09:11:03 EST
On a manifest import, there are two causes of entitlement regens:

- ProductImporter detecting changes will regenerate any entitlements that use the 
  referenced product.

- Importer calls refreshPools.

ProductImporter and refreshPools can very easily regenerate the same entitlements.
In addition, with the new environment/content changes, ProductImporter might regenerate an entitlement that doesn't even have content that was altered.

IMO, We should teach ProductImporter to: Iterate over all imported products. If the product's toplevel information or attributes have changed, determine all entitlements that will need to be regenerated, and keep this as a set.
For any products other products, if a product's content set is modified or deleted, add all entitlements that use that content set to the set of entitlements that need to be regenerated. Pass this set back up to importer.

refreshPools now needs some way to pass up all entitlements that it would regenerate, and instead of regenerating them, return them to Importer.
Importer can now merge these two lists, and now regenerate each entitlement once and only once.

Lastly, ProductImporter should be copying modified attributes onto all pools that reference that product (across all orgs).
Comment 2 Alex Wood 2012-03-05 15:09:54 EST
Committed 4b58e8a949625cef4599b554bd902425a078fbc7

Available 0.5.24+
Comment 3 James Bowes 2012-03-05 15:20:11 EST
Ignore that last bit about copying modified attributes. that's a different issue, so I opened a new bug for it: https://bugzilla.redhat.com/show_bug.cgi?id=800145
Comment 5 Tazim Kolhar 2012-11-27 00:00:28 EST
Hi all,
Please provide the verification steps to complete the testing. thanks
Comment 6 Alex Wood 2012-11-27 12:50:37 EST
This bug is verified through our unit test suite.  Unfortunately, there is no real way to test this by hand.
Comment 8 Bryan Kearney 2013-06-07 13:24:56 EDT
Closing out verified bugs from 1.2. Somehow the errata tool missed them.
Comment 9 Bryan Kearney 2013-06-07 13:25:46 EDT
Closing out verified bugs from 1.2. Somehow the errata tool missed them.

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