ceph / ceph-csi

CSI driver for Ceph
Apache License 2.0
1.29k stars 548 forks source link

cleanup: rework approach to traverse rbd image chain #2144

Open Yuggupta27 opened 3 years ago

Yuggupta27 commented 3 years ago

In current approach for iteration of chained images in functions like getCloneDepth() and checkImageChainHasFeature(), we re-use and update an rbdVolume with different attributes which is quite wrong. https://github.com/ceph/ceph-csi/blob/7b5c78ec7c36b98433d19956efba2bf061dc3428/internal/rbd/rbd_util.go#L563

Rework the loop such that: we create and destroy a new volume inside the loop and use it for iteration and not just change parameters of the existing volume.

With this, we might be able to reduce complexity and it will minimize the redundant code in both functions.

See https://github.com/ceph/ceph-csi/pull/1838#discussion_r598530807 cc @nixpanic

humblec commented 3 years ago

As discussed we have to continue the analysis and get into the completion in upcoming releases. Moving this out of 3.4.0 release.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

humblec commented 3 years ago

@Yuggupta27 just to revisit .

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.