Bug 1507119

Summary: oc apply and replace terminate upgrades if a resource update is contentious
Product: OpenShift Container Platform Reporter: Justin Pierce <jupierce>
Component: Cluster Version OperatorAssignee: Stephen Cuppett <scuppett>
Status: CLOSED ERRATA QA Contact: liujia <jiajliu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6.1CC: aos-bugs, jokerman, lucarval, mkhan, mmccomas, scuppett
Target Milestone: ---   
Target Release: 3.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Retries have been added to shared-resource-viewer update logic avoiding problems with object contention.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-26 04:10:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Pierce 2017-10-27 18:22:48 UTC
Description of problem:

Errors like:
TASK [Fixup shared-resource-viewer role] ***************************************
Friday 27 October 2017  18:05:27 +0000 (0:00:00.494)       0:17:25.352 ******** 
fatal: [engint-master-81c2f]: FAILED! => {"changed": false, "failed": true, "msg": {"cmd": "/usr/bin/oc replace -f /tmp/shared_resource_viewer_role.yaml -n openshift", "results": {}, "returncode": 1, "stderr": "Error from server (Conflict): error when replacing \"/tmp/shared_resource_viewer_role.yaml\": Operation cannot be fulfilled on name.authorization.openshift.io \"shared-resource-viewer\": the object has been modified; please apply your changes to the latest version and try again\n", "stdout": ""}}
changed: [engint-master-b8539]
changed: [engint-master-39a9e]

are inevitable in OpenShift for some objects. If this error is encountered, operations like replace & apply could be automatically retried instead of terminating the upgrade. 

Version:
openshift-ansible-3.6.173.0.59

Comment 2 Luiz Carvalho 2017-12-06 15:32:42 UTC
Also have this issue. Re-running the upgrade plugin caused the upgrade to complete successfully. (3.5 -> 3.6)

Comment 3 Scott Dodson 2018-01-23 21:58:31 UTC
Mo,

This seems like something that's been fixed in the client recently, does that seem correct?

--
Scott

Comment 4 Mo 2018-01-24 22:38:14 UTC
Not that I am aware of.  Since this step only applies from 3.5 to 3.6, I suggested adding 10 retries via ansible.

Comment 7 liujia 2018-09-14 01:10:32 UTC
1. Install ocp v3.6.173.0.48
2. Upgrade ocp to v3.6.173.0.59

Upgrade succeed. Can not re-produce on v3.6.173.0.59

Comment 8 liujia 2018-09-14 01:27:01 UTC
Checked the pr9733, I think this enhancement can help improve the process instead of re-run upgrade because failure of operations like replace & apply are inevitable.Adding some retried is necessary. 

So QE will check the pr and verify upgrade works well on latest v3.6

Comment 9 liujia 2018-09-14 03:25:32 UTC
Version:openshift-ansible-3.6.173.0.130-1.git.0.22ddff9.el7.noarch

Upgrade ovp v3.6.173.0.48 to v3.6.173.0.130 succeed.
Upgrade ocp v3.5.5.31.67 to v3.6.173.0.130 succeed.

Comment 11 errata-xmlrpc 2018-09-26 04:10:45 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/RHSA-2018:2654