Bug 1279344 - Inconsistent PV and PVC bound displayed
Summary: Inconsistent PV and PVC bound displayed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: ---
Assignee: Mark Turansky
QA Contact: Liang Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-09 08:56 UTC by Jianwei Hou
Modified: 2016-05-12 16:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 16:25:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1064 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 3.2 security, bug fix, and enhancement update 2016-05-12 20:19:17 UTC

Description Jianwei Hou 2015-11-09 08:56:27 UTC
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 15:57:38 UTC
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-27 03:45:22 UTC
Bug fix is upstream:  https://github.com/kubernetes/kubernetes/pull/20197

Comment 5 Mark Turansky 2016-02-18 14:23:09 UTC
I verified #20197 is in Origin after the most recent rebase.

Comment 6 Jianwei Hou 2016-02-22 10:50:39 UTC
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 16:25:17 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


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