Whamcloud - gitweb
LU-14207 mgs: delete "add failnid" sections on replace_nids 30/40930/3
authorArtem Blagodarenko <artem.blagodarenko@hpe.com>
Wed, 14 Oct 2020 01:54:36 +0000 (21:54 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 20:13:24 +0000 (20:13 +0000)
Replace_nids left old nids in add_conn field of failnid
section of client llog. This leads to connecton errors.

Let's delete such sections. New failnids, if any, are
added by replace_nids.

Change-Id: I7fab00827035bd864aeb95fb4852a59c458bb2ba
HPE-bug-id: LUS-9440
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@hpe.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Tested-by: Jenkins Build User <nssreleng@cray.com>
Reviewed-on: https://review.whamcloud.com/40930
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mgs/mgs_llog.c
lustre/tests/conf-sanity.sh

index 28203c1..b7dee73 100644 (file)
@@ -1025,10 +1025,19 @@ static int check_markers(struct lustre_cfg *lcfg,
                        LASSERT(!(marker->cm_flags & CM_START) ||
                                !(marker->cm_flags & CM_END));
                        if (marker->cm_flags & CM_START) {
-                               mrd->state = REPLACE_UUID;
-                               mrd->failover = NULL;
+                               if (!strncmp(marker->cm_comment,
+                                            "add failnid", 11)) {
+                                       mrd->state = REPLACE_SKIP;
+                               } else {
+                                       mrd->state = REPLACE_UUID;
+                                       mrd->failover = NULL;
+                               }
                        } else if (marker->cm_flags & CM_END)
                                mrd->state = REPLACE_COPY;
+
+                       if (!strncmp(marker->cm_comment,
+                               "add failnid", 11))
+                               return 1;
                }
        }
 
@@ -1223,6 +1232,11 @@ static int process_command(const struct lu_env *env, struct lustre_cfg *lcfg,
                return rc ? rc : 1;
        }
 
+       /* All new UUID are added. Skip. */
+       if (mrd->state == REPLACE_SETUP &&
+               lcfg->lcfg_command == LCFG_ADD_UUID)
+               return 1;
+
        /* Another commands in target device block */
        return 0;
 }
index 3bf8598..2e390d1 100644 (file)
@@ -8905,6 +8905,12 @@ test_124()
        [ -z $mds2failover_HOST ] && skip "needs MDT failover setup"
 
        setup
+       do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+               grep 1.2.3.4@tcp && error "Should not be fake nid"
+       do_facet mgs $LCTL conf_param $FSNAME-MDT0001.failover.node=1.2.3.4@tcp\
+               || error "Set params error"
+       do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+               grep 1.2.3.4@tcp || error "Fake nid should be added"
        cleanup
 
        load_modules