Description
===========
The promote share replica s using the NetApp driver.
Steps to reproduce
==================
* Create a share replica of the created share
* Wait for the replica to achieve 'in_sync' state
* Promote the share replica
* Wait for error
* sometime replica gets promoted, but sometime it fails.
filed bug to address failure scenario.
Possible description
====================
when replica state is retrieved from DB, it might be in IN_SYNC state. However this state is updated every 5 minute, it is possible that replica becomes OUT_SYNC after its state is read from backend. Then user tries to promote replica assuming its in IN_SYNC state. Also when retrieve from DB, state is IN_SYNC, but thereafter promotion fails since replica is actually OUT_SYNC. So retrieve current state from backend, then update in db and then try to promote only if its in IN_SYNC.
Link to the proposed fix https:/ /review. opendev. org/c/openstack /manila/ +/856539