From 9065e7c09cc4f7b5ac611e35c61fc7f571cd40a0 Mon Sep 17 00:00:00 2001 From: Douglas Viroel Date: Fri, 18 Oct 2019 10:47:03 -0300 Subject: [PATCH] [NetApp] Fix share replica failing for 'transfer in progress' error This patch fix an issue in NetApp driver share replica periodic check that erroneuouly set a share replica to error after receiving a 'Another transfer is in progress' error. The driver now skips the resync operation for all expected transfer in progress relationship status. Closes-Bug: #1848889 Change-Id: If82aaa184db84660389f82654279f3c5b238fd51 (cherry picked from commit 572be43bb03a67376b52a11c70e587eb160b68a3) (cherry picked from commit cc2dea14a514ad1a7025d904074307817c60e3ce) (cherry picked from commit 48f3e09d12f38084a16309360fd2fbdddd441c4f) (cherry picked from commit d03dc6ef512f211cc81b83a62499c897dcefd3bc) --- .../drivers/netapp/dataontap/cluster_mode/lib_base.py | 7 +++++-- ...re-replica-update-check-failure-90aa964417e7734c.yaml | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1848889-netapp-fix-share-replica-update-check-failure-90aa964417e7734c.yaml diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py index 3b4531e917..e3c4199dde 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py @@ -1542,9 +1542,12 @@ class NetAppCmodeFileStorageLibrary(object): return constants.REPLICA_STATE_OUT_OF_SYNC snapmirror = snapmirrors[0] - + # NOTE(dviroel): Don't try to resume or resync a SnapMirror that has + # one of the in progress transfer states, because the storage will + # answer with an error. + in_progress_status = ['preparing', 'transferring', 'finalizing'] if (snapmirror.get('mirror-state') != 'snapmirrored' and - snapmirror.get('relationship-status') == 'transferring'): + snapmirror.get('relationship-status') in in_progress_status): return constants.REPLICA_STATE_OUT_OF_SYNC if snapmirror.get('mirror-state') != 'snapmirrored': diff --git a/releasenotes/notes/bug-1848889-netapp-fix-share-replica-update-check-failure-90aa964417e7734c.yaml b/releasenotes/notes/bug-1848889-netapp-fix-share-replica-update-check-failure-90aa964417e7734c.yaml new file mode 100644 index 0000000000..e06bc09ea0 --- /dev/null +++ b/releasenotes/notes/bug-1848889-netapp-fix-share-replica-update-check-failure-90aa964417e7734c.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + Fixed an issue in NetApp driver share replica periodic check that + erroneously set a replica state to 'error'. In this routine, a SnapMirror + resync operation was being triggered while the replica data transfering is + still in progress, receiving an error from the storage side. The driver now + skips resync operation for all in progress SnapMirror relationship status. +