Bug 1279344 - Inconsistent PV and PVC bound displayed
Inconsistent PV and PVC bound displayed
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage (Show other bugs)
3.1.0
Unspecified Unspecified
low Severity medium
: ---
: ---
Assigned To: Mark Turansky
Liang Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-09 03:56 EST by Jianwei Hou
Modified: 2016-05-12 12:25 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 12:25:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jianwei Hou 2015-11-09 03:56:27 EST
Description of problem:
Delete and create a new PVC with same name before the bound PV is released, the PVC is always shown bound to the PV even if it is not.

Version-Release number of selected component (if applicable):
openshift v3.1.0.2
kubernetes v1.1.0-origin-1107-g4c8e6f4
etcd 2.1.2

How reproducible:
Always

Steps to Reproduce:
1. Create 2 PVs with accessMode RWX and RWO respectively
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/nfs/nfs-default-rwx.json
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/nfs/nfs-recycle-rwo.json

2. Create a PVC with accessMode RWX
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/nfs/claim-rwx.json

3. After the PVC is bound, delete it, immediately before the PV is released, create another PVC with accessMode RWO, the PVC should have same name with the deleted PVC
oc delete pvc nfsc
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/persistent-volumes/nfs/claim-rwo.json

4. List all PVs: 'oc get pv'
5. List PVC: 'oc get pvc'

Actual results:
After step 4:
The 'oc get pv' shows that 1 PVC bound to 2 different PVs
NAME              LABELS    CAPACITY   ACCESSMODES   STATUS     CLAIM                              REASON    AGE                                                       
nfs               <none>    5Gi        RWX           Bound      jhou/nfsc                                    13m
nfsj              <none>    5Gi        RWO           Bound      jhou/nfsc                                    13m


After step 5:
The PVC is bound to the PV that is RWO

NAME      LABELS    STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
nfsc      <none>    Bound     nfsj      5Gi        RWO           12m


Expected results:
The PV with accessMode RWX should be in released/available status depending on it's reclaim policy, it should not be shown as 'Bound' to the deleted PVC.

Additional info:
Comment 2 Mark Turansky 2016-01-26 10:57:38 EST
The bug here is the controller looking at the claim namespace and name when comparing what a volume is bound to.  The 2nd claim used in the example above has the same name/namespace, so the volume sees the existing claim and thinks it is still bound.

The solution is to compare object UIDs instead of namespace/name.
Comment 3 Mark Turansky 2016-01-26 22:45:22 EST
Bug fix is upstream:  https://github.com/kubernetes/kubernetes/pull/20197
Comment 5 Mark Turansky 2016-02-18 09:23:09 EST
I verified #20197 is in Origin after the most recent rebase.
Comment 6 Jianwei Hou 2016-02-22 05:50:39 EST
Verified on:
openshift v3.1.1.903
kubernetes v1.2.0-origin
etcd 2.2.2+git

The issue is not reproducible, the bug is fixed
Comment 8 errata-xmlrpc 2016-05-12 12:25:17 EDT
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

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