Description
===========
Promoting replicas results in unused snapshots being held in the ONTAP volumes, causing undesirable space consumption. The NetApp driver must release previous SnapMirror relationships in order to remove any locks to snapshots that are no longer needed, allowing ONTAP to automatically clean up snapshots.
Steps to reproduce
==================
1) Create a share with replication enabled;
2) Promote an 'in-sync' replica as the new source;
3) Promoting the original source (the active replica prior to the first promotion operation);
4) Calling 'snapmirror update' in the ONTAP system does not delete unused snapshots.
Expected result
===============
After successfully promoting a replica to a new source, all SnapMirror relationship entries with the previous source (the active replica prior to the promote operation) must be released to prevent ONTAP from retaining locks of the prior relationship setup. After that, ONTAP will automatically clean up unused snapshots by attempting a scheduled SnapMirror update.
Actual result
=============
NetApp driver does not issue a SnapMirror release operation after replica promotion to release the relationship with the prior active/source replica, resulting in the ONTAP retaining unused snapshots and consuming unnecessary resources.
Environment
===========
OpenStack Yoga (also reproducible in older releases)
NetApp ONTAP 9. x
Additional comments at https:/ /meetings. opendev. org/meetings/ manila/ 2022/manila. 2022-07- 28-15.00. log.html