Bug 1882630 - Fstype is changed after deleting pv provisioned by localvolumeset instance
Summary: Fstype is changed after deleting pv provisioned by localvolumeset instance
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Santosh Pillai
QA Contact: Chao Yang
URL:
Whiteboard:
Depends On:
Blocks: 1872079 1885648 1885700
TreeView+ depends on / blocked
 
Reported: 2020-09-25 08:17 UTC by Chao Yang
Modified: 2021-02-24 15:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:21:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift local-storage-operator pull 161 0 None closed Bug 1882630: fix stale lsblk output 2021-01-05 20:26:05 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:22:07 UTC

Description Chao Yang 2020-09-25 08:17:17 UTC
Description of problem:
Fstype is changed after deleting pv provisioned by localvolumeset instance

Version-Release number of selected component (if applicable):
4.6.0-0.nightly-2020-09-24-030538
local-storage-operator.4.6.0-202009231847.p0

How reproducible:
Always

Steps to Reproduce:
1.Install LSO
2.Create localvolumediscovery
3.Create localvolumeset
apiVersion: v1
items:
- apiVersion: local.storage.openshift.io/v1alpha1
  kind: LocalVolumeSet
  metadata:
    creationTimestamp: "2020-09-25T05:54:59Z"
    generation: 1
    managedFields:
    - apiVersion: local.storage.openshift.io/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        f:spec:
          .: {}
          f:deviceInclusionSpec:
            .: {}
            f:deviceMechanicalProperties: {}
            f:deviceTypes: {}
          f:nodeSelector:
            .: {}
            f:nodeSelectorTerms: {}
          f:storageClassName: {}
          f:volumeMode: {}
      manager: Mozilla
      operation: Update
      time: "2020-09-25T05:54:59Z"
    - apiVersion: local.storage.openshift.io/v1alpha1
      fieldsType: FieldsV1
      fieldsV1:
        f:spec:
          f:deviceInclusionSpec:
            f:minSize: {}
        f:status:
          .: {}
          f:conditions: {}
          f:observedGeneration: {}
          f:totalProvisionedDeviceCount: {}
      manager: local-storage-operator
      operation: Update
      time: "2020-09-25T06:11:26Z"
    name: lvs
    namespace: openshift-local-storage
    resourceVersion: "1132670"
    selfLink: /apis/local.storage.openshift.io/v1alpha1/namespaces/openshift-local-storage/localvolumesets/lvs
    uid: cfb012ad-89c6-42f5-98ba-529a8bbdbc2f
  spec:
    deviceInclusionSpec:
      deviceMechanicalProperties:
      - NonRotational
      deviceTypes:
      - disk
      - part
      minSize: 0Ti
    nodeSelector:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
          - ip-10-0-143-32
          - ip-10-0-190-41
          - ip-10-0-212-186
    storageClassName: lvs
    volumeMode: Filesystem
  status:
    conditions:
    - lastTransitionTime: "2020-09-25T05:54:59Z"
      message: 'DiskMaker: Available, LocalProvisioner: Available'
      status: "True"
      type: DaemonSetsAvailable
    - lastTransitionTime: "2020-09-25T05:55:00Z"
      message: Operator reconciled successfully.
      status: "True"
      type: Available
    observedGeneration: 1
    totalProvisionedDeviceCount: 4
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

3.PV is provisioned
4.Create pvc/pod using above pv
oc get pvc
NAME   STATUS   VOLUME              CAPACITY   ACCESS MODES   STORAGECLASS   AGE
pvc5   Bound    local-pv-485b8629   10Gi       RWO            lvs            7m20s
5.Check localvolumediscoveryresult
 - deviceID: /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol024547723ded32e1d
    fstype: ext4
    model: 'Amazon Elastic Block Store              '
    path: /dev/nvme1n1
    property: NonRotational
    serial: vol024547723ded32e1d
    size: 10737418240
    status:
      state: NotAvailable
    type: disk
    vendor: ""
  discoveredTimeStamp: "2020-09-25T06:03:56Z"
6.Delete pod/pvc
7.Waiting for the pv is available
  - deviceID: /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol024547723ded32e1d
    fstype: ext2
    model: 'Amazon Elastic Block Store              '
    path: /dev/nvme1n1
    property: NonRotational
    serial: vol024547723ded32e1d
    size: 10737418240
    status:
      state: NotAvailable
    type: disk
    vendor: ""
  discoveredTimeStamp: "2020-09-25T06:13:56Z"

Actual results:
pv fstype is changed from ext4 to ext2 after deleting pod/pvc

Expected results:
pv fstype should not changed

Master Log:

Node Log (of failed PODs):

PV Dump:

PVC Dump:

StorageClass Dump (if StorageClass used by PV/PVC):

Additional info:

Comment 1 Santosh Pillai 2020-09-25 12:48:23 UTC
is it happening with LocalVolumeSet only or with LocalVolume as well?

Comment 2 Rohan CJ 2020-09-29 15:39:35 UTC
The root cause is that `lsblk -o +fstype` info is out of date.

Running `udevadm trigger` before `lsblk` refreshes it, but is considered somewhat expensive.

We could run it only on the discovery pod (every 5 minutes) because by the time we run into this the localvolume/localvolumeset controller has already finished its job (symlinking).

Comment 3 Rohan CJ 2020-09-30 07:21:28 UTC
Moving out to 4.7 as per discussion.

Comment 6 Chao Yang 2020-10-10 11:13:58 UTC
1.Create pvc/pod
  - deviceID: /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol0b9b38a379841f8e0
    fstype: ext4
    model: 'Amazon Elastic Block Store              '
    path: /dev/nvme2n1
    property: NonRotational
    serial: vol0b9b38a379841f8e0
    size: 1073741824
    status:
      state: NotAvailable
    type: disk
    vendor: ""
  discoveredTimeStamp: "2020-10-10T05:42:06Z"

2.Delete pod/pvc
  - deviceID: /dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol0b9b38a379841f8e0
    fstype: ""
    model: 'Amazon Elastic Block Store              '
    path: /dev/nvme2n1
    property: NonRotational
    serial: vol0b9b38a379841f8e0
    size: 1073741824
    status:
      state: Available
    type: disk
    vendor: ""
  discoveredTimeStamp: "2020-10-10T05:52:06Z"

 oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2020-10-08-210814   True        False         20h     Cluster version is 4.6.0-0.nightly-2020-10-08-210814

Comment 7 Chao Yang 2020-10-10 11:16:11 UTC
When pv is in available, blkid will return empty for /dev/nvme2n1, so the fstype is empty also.

@hekumar Can we accept this?

Comment 9 Hemant Kumar 2020-10-19 15:03:20 UTC
> When pv is in available, blkid will return empty for /dev/nvme2n1, so the fstype is empty also.
> @hekumar Can we accept this?

That seems fine. Deleting the PVC results in calling wipefs on volume and hence fstype is empty. And although there is a PV on it, currently we don't track unused PVs and mark backing devices as "Unavailable". We could *do* that for local-storage PVs I think, by checking for existing symlinks in `/mnt/local-storage` for the backing device. Is that what you were expecting Chao Yang?

Comment 14 errata-xmlrpc 2021-02-24 15:21:14 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), 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-2020:5633


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