Bug 1317835

Summary: Update host for route doesn't take effect
Product: OpenShift Container Platform Reporter: Yan Du <yadu>
Component: NetworkingAssignee: Maru Newby <mnewby>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, bmeng, mnewby, tdawson
Version: 3.2.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-12 16:32:54 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 Yan Du 2016-03-15 10:25:10 UTC
Description of problem:
Create a route and try to update the host for route by oc edit route, but the change doesn't take effect after save and quit the edit, and no warning information show up


Version-Release number of selected component (if applicable):
oc v3.2.0.3
kubernetes v1.2.0-origin-41-g91d3e75


How reproducible:
Always


Steps to Reproduce:
1. Create pod/service/route
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/nginx-pod.json
# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/routing/unsecure/service_unsecure.json
# oc create route edge myroute --service=hello-nginx --hostname=www.edge.com
# oc get route
NAME      HOST/PORT      PATH      SERVICE            TERMINATION   LABELS
myroute   www.edge.com             hello-nginx:http   edge          name=hello-nginx

2. Try to update the host for route, eg change www.edge.com to www.edge1.com
# oc edit route myroute
 
3. Check the route


Actual results:
The change for route doesn't take effect
step3: The route is still same
# oc get route
NAME      HOST/PORT      PATH      SERVICE            TERMINATION   LABELS
myroute   www.edge.com             hello-nginx:http   edge          name=hello-nginx



Expected results:
The host could be updated successfully. If the host is not allowed to change, at least some friendly warnings show up



Additional info:
The route after updating 

# oc get route -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: Route
  metadata:
    creationTimestamp: 2016-03-15T10:04:57Z
    labels:
      name: hello-nginx
    name: myroute
    namespace: d2
    resourceVersion: "2493"
    selfLink: /oapi/v1/namespaces/d2/routes/myroute
    uid: 5f3cc539-ea95-11e5-bb44-fa163ec44b15
  spec:
    host: www.edge1.com
    port:
      targetPort: http
    tls:
      termination: edge
    to:
      kind: Service
      name: hello-nginx
  status:
    ingress:
    - conditions:
      - lastTransitionTime: 2016-03-15T10:04:58Z
        status: "True"
        type: Admitted
      host: www.edge.com
      routerName: router
kind: List
metadata: {}

Comment 1 Maru Newby 2016-03-17 15:15:05 UTC
I can reproduce.  The edit to the route is successful, and the router picks up the edit and reconfigures itself for the new hostname.  However, 'oc get route' prefers the host of the ingress status which is not being updated when the host of a route changes.

Comment 2 Maru Newby 2016-03-18 16:46:23 UTC
I have a partial diagnosis.  

When the status plugin encounters a route for the first time it writes the update time to its timestamp cache with nanosecond precision, but the ingress timestamp is not stored with nanosecond precision.  When the host for the route is subsequently updated, the status plugin finds the most recent ingress timestamp to not match its cached timestamp and, assuming this to mean that another route has updated the ingress status, does not update the ingress status for the route with the updated host.

Bouncing the router pod with 'oc dc router --latest' clears the router's timestamp cache and all subsequent router updates are correctly handled by the status plugin.

I'm assuming the fix is truncating the nanosecond portion of timestamps before they are stored in the status plugin's timestamp cache, but need to confirm this.

Comment 3 Maru Newby 2016-03-23 03:38:37 UTC
The origin PR has merged.

Comment 4 Troy Dawson 2016-03-28 18:47:29 UTC
This has been merged into OSE and is in release v3.2.0.8

Comment 5 Yan Du 2016-03-29 07:14:31 UTC
Test on latest ose env

openshift v3.2.0.8
kubernetes v1.2.0-36-g4a3f9c5
etcd 2.2.5


Issue have been fixed, route could be updated successfully, move bug to verified

Comment 7 errata-xmlrpc 2016-05-12 16:32:54 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-2016:1064