Bug 785170 - Possible duplicate and unneeded entitlement regenerations on import
Summary: Possible duplicate and unneeded entitlement regenerations on import
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: candlepin
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Alex Wood
QA Contact: Tazim Kolhar
URL:
Whiteboard:
Depends On:
Blocks: sam12-tracker
TreeView+ depends on / blocked
 
Reported: 2012-01-27 14:11 UTC by James Bowes
Modified: 2016-04-26 00:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-07 17:19:56 UTC
Embargoed:
tkolhar: needinfo+


Attachments (Terms of Use)

Description James Bowes 2012-01-27 14:11:03 UTC
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 20:09:54 UTC
Committed 4b58e8a949625cef4599b554bd902425a078fbc7

Available 0.5.24+

Comment 3 James Bowes 2012-03-05 20:20:11 UTC
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 05:00:28 UTC
Hi all,
Please provide the verification steps to complete the testing. thanks

Comment 6 Alex Wood 2012-11-27 17:50:37 UTC
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 17:24:56 UTC
Closing out verified bugs from 1.2. Somehow the errata tool missed them.

Comment 9 Bryan Kearney 2013-06-07 17:25:46 UTC
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.