Bug 2141594

Summary: Metadata generated previously for CSI_ENABLE_METADATA enabled displaying for operations done after disabling CSI_ENABLE_METADATA for RBD
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Amrita Mahapatra <ammahapa>
Component: csi-driverAssignee: Madhu Rajanna <mrajanna>
Status: CLOSED CURRENTRELEASE QA Contact: Amrita Mahapatra <ammahapa>
Severity: low Docs Contact:
Priority: low    
Version: 4.12CC: bniver, ebenahar, mrajanna, muagarwa, ocs-bugs, odf-bz-bot, pnataraj
Target Milestone: ---   
Target Release: ODF 4.12.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.12.0-113 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-02-08 14:06:28 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 Amrita Mahapatra 2022-11-10 08:14:24 UTC
Description of problem (please be detailed as possible and provide log
snippests):
For ocs-storagecluster-ceph-rbd storage class
* Enable metadata flag
* Create PVC
* Disable metadata flag
* Create clone/snapshot
For this scenario operations done after disabling CSI_ENABLE_METADATA flag are still displaying the metadata details generated previously when CSI_ENABLE_METADATA flag enabled.

oc get cm rook-ceph-operator-config -o yaml
apiVersion: v1
data:
  CSI_ENABLE_METADATA: "true"
  CSI_ENABLE_OMAP_GENERATOR: "true"
kind: ConfigMap
metadata:
  creationTimestamp: "2022-11-03T17:22:32Z"
  name: rook-ceph-operator-config
  namespace: openshift-storage
  resourceVersion: "12934242"
  uid: f5bfc9a4-5b2c-47f3-90fa-4676f5324cef

Metadata for the pvc created----
created sub-volume - csi-vol-f882e89b-e740-4eea-b500-e6b59052f44d

oc -n openshift-storage rsh rook-ceph-tools-868cff5cf6-k9rjd rbd image-meta ls ocs-storagecluster-cephblockpool/csi-vol-f882e89b-e740-4eea-b500-e6b59052f44d
There are 4 metadata on this image:

Key                               Value                                   
csi.ceph.com/cluster/name         5c8a5f86-b978-4b1d-9274-9fb9d42898d6    
csi.storage.k8s.io/pv/name        pvc-723909d8-1805-475b-afbc-f0f31615a441
csi.storage.k8s.io/pvc/name       pvc2                                    
csi.storage.k8s.io/pvc/namespace  openshift-storage


Disable CSI_ENABLE_METADATA flag ----
oc patch cm rook-ceph-operator-config -n openshift-storage -p '{"data":{"CSI_ENABLE_METADATA": "false"}}'
configmap/rook-ceph-operator-config patched

oc get cm -n openshift-storage rook-ceph-operator-config -o yaml
apiVersion: v1
data:
  CSI_ENABLE_METADATA: "false"
  CSI_ENABLE_OMAP_GENERATOR: "true"
kind: ConfigMap
metadata:
  creationTimestamp: "2022-11-03T17:22:32Z"
  name: rook-ceph-operator-config
  namespace: openshift-storage
  resourceVersion: "12944473"
  uid: f5bfc9a4-5b2c-47f3-90fa-4676f5324cef


Clone the PVC and check metadata----
created sub-volume - csi-vol-8f405db6-1eba-43d1-81b3-d30d3e6c299c

oc -n openshift-storage rsh rook-ceph-tools-868cff5cf6-k9rjd rbd image-meta ls ocs-storagecluster-cephblockpool/csi-vol-8f405db6-1eba-43d1-81b3-d30d3e6c299c
There are 4 metadata on this image:

Key                               Value                                   
csi.ceph.com/cluster/name         5c8a5f86-b978-4b1d-9274-9fb9d42898d6    
csi.storage.k8s.io/pv/name        pvc-723909d8-1805-475b-afbc-f0f31615a441
csi.storage.k8s.io/pvc/name       pvc2                                    
csi.storage.k8s.io/pvc/namespace  openshift-storage

Create snapshot of the cloned PVC and check metadata----
created sub-volume - csi-snap-053b3903-2b86-49ae-adf5-a6c1c790ad26

oc -n openshift-storage rsh rook-ceph-tools-868cff5cf6-k9rjd rbd image-meta ls ocs-storagecluster-cephblockpool/csi-snap-053b3903-2b86-49ae-adf5-a6c1c790ad26
There are 4 metadata on this image:

Key                               Value                                   
csi.ceph.com/cluster/name         5c8a5f86-b978-4b1d-9274-9fb9d42898d6    
csi.storage.k8s.io/pv/name        pvc-723909d8-1805-475b-afbc-f0f31615a441
csi.storage.k8s.io/pvc/name       pvc2                                    
csi.storage.k8s.io/pvc/namespace  openshift-storage


Version of all relevant components (if applicable):
OCP version --- 4.12.0-0.nightly-2022-10-25-210451
OCS version --- 4.12.0-87


Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)? No


Is there any workaround available to the best of your knowledge? No


Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)? 3


Can this issue reproducible? Yes


Can this issue reproduce from the UI? No


If this is a regression, please provide more details to justify this: NA


Steps to Reproduce:
1. Enable metadata flag
2. Create PVC
3. Check the metadata created
4. Disable metadata flag
5. Create clone/snapshot
6. Check the metadata created

Actual results: Operations done after disabling CSI_ENABLE_METADATA flag are still displaying the metadata details generated previously for CSI_ENABLE_METADATA flag enabled.


Expected results: For operations done after disabling CSI_ENABLE_METADATA flag metadata should not be available. 


Additional info: