Whamcloud - gitweb
LU-8271 nodemap: wait before getting large conf if changed 81/26781/6
authorKit Westneat <kit.westneat@gmail.com>
Fri, 21 Apr 2017 18:57:42 +0000 (14:57 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Jan 2018 02:48:16 +0000 (02:48 +0000)
If a nodemap configuration spans multiple RPCs, it's possible for the
nodemap config to change between RPCs. Previously, the MGC would
immediately retry to get the nodemap config. This patch modifies the
behavior so the nodemap config lock is readded to the wait queue,
which will delay retrying by ~10s.

Test-Parameters: envdefinitions=SLOW=yes \
testlist=sanity-sec,sanity-sec,sanity-sec

Signed-off-by: Kit Westneat <kit.westneat@gmail.com>
Change-Id: Ie4e70def712e5eaa38adecc450e39c0380e34b69
Reviewed-on: https://review.whamcloud.com/26781
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mgc/mgc_request.c

index c08ed96..bccef43 100644 (file)
@@ -1753,15 +1753,8 @@ again:
 #ifdef HAVE_SERVER_SUPPORT
                /* config changed since first read RPC */
                if (cld_is_nodemap(cld) && config_read_offset == 0) {
-                       recent_nodemap = NULL;
-                       nodemap_config_dealloc(new_config);
-                       new_config = NULL;
-
                        CDEBUG(D_INFO, "nodemap config changed in transit, retrying\n");
-
-                       /* setting eof to false, we request config again */
-                       eof = false;
-                       GOTO(out, rc = 0);
+                       GOTO(out, rc = -EAGAIN);
                }
 #endif
                if (!eof)
@@ -2159,6 +2152,12 @@ restart:
                        CERROR("Can't drop cfg lock: %d\n", rcl);
        }
 
+       /* requeue nodemap lock immediately if transfer was interrupted */
+       if (cld_is_nodemap(cld) && rc == -EAGAIN) {
+               mgc_requeue_add(cld);
+               rc = 0;
+       }
+
        RETURN(rc);
 }