Bug 1764197

Summary: multiple workers start the same retirement when retirement date is reached
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED ERRATA QA Contact: Ganesh Hubale <ghubale>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.8CC: dmetzger, fdewaley, ghubale, gmccullo, lufu, mkanoor, obarenbo, simaishi, smallamp, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.10.12   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.10.12.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1748353 Environment:
Last Closed: 2019-11-06 08:58:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1748353    
Bug Blocks:    

Comment 2 CFME Bot 2019-10-22 14:50:34 UTC
New commit detected on ManageIQ/manageiq/hammer:

https://github.com/ManageIQ/manageiq/commit/f5a156b6583ca757b84e372455df7b1c5b95e368
commit f5a156b6583ca757b84e372455df7b1c5b95e368
Author:     Brandon Dunne <bdunne>
AuthorDate: Tue Aug 20 16:36:52 2019 -0400
Commit:     Brandon Dunne <bdunne>
CommitDate: Tue Aug 20 16:36:52 2019 -0400

    Merge pull request #19143 from lfu/dup_service_retire_request_18558

    Service retirement request should be per region.

    (cherry picked from commit 3ab4626c51447481724d8b720c9e83c0ee788a9d)

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

 app/models/miq_schedule_worker/jobs.rb | 1 +
 app/models/retirement_manager.rb | 7 +-
 spec/models/retirement_manager_spec.rb | 13 +-
 3 files changed, 16 insertions(+), 5 deletions(-)

Comment 3 Ganesh Hubale 2019-10-25 12:06:56 UTC
Hi Tina, 

Please provide steps and expected result to verify this BZ?
This will be very helpful :)

Thanks,
Ganesh

Comment 5 Tina Fitzgerald 2019-10-28 21:36:51 UTC
Hi Ganesh,

1. Setup an environment where you have 2 appliances in the same region, each with their own zone. 
2. Create a service item that provisions a VM(the type doesn't matter)
3. Order the service to ensure it provisions the VM properly.
4. Navigate to the Active Services page, and select lifecycle, set retirement date, to today.
5. Look for RetirementManager.check in the appliances evm.log, and look for retirement being called twice for the same service.
Note - I can help with step 5, just ping me with the service name and appliance ip addresses.

Let me know if you have any questions.

Thanks,
Tina

Comment 6 Ganesh Hubale 2019-10-30 13:38:23 UTC
Thank you so much @Tina for detailed steps.

I have created setup with two appliance in one region and added them into different zones. And performed other steps. 

I can see RetirementManager.check ran on both appliances but the request to retire the service only happened once.

Hence verifying this BZ on version: 5.10.12.1.20191022171907_f883bde

Comment 8 errata-xmlrpc 2019-11-06 08:58:35 UTC
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.

https://access.redhat.com/errata/RHBA-2019:3268

Comment 9 Sudhir Mallamprabhakara 2019-12-03 15:35:56 UTC
updating test coverage flag based on the original BZ - BZ1748353