Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.14.0
    • Lustre 2.14.0, Lustre 2.12.5
    • 3
    • 9223372036854775807

    Description

      I created a subdirectory and put a mirrored file in it. When I tried to migrate the mirrored file to another MDT, it returned an error migrating the mirrored file that I didn't expect:

      tests# lfs mkdir -i 0 /mnt/testfs/dir1
      tests# cp /etc/hosts /mnt/testfs/dir1
      tests# lfs mirror extend -N1 /mnt/testfs/dir1/hosts
      tests# lfs migrate -m 1 /mnt/testfs/dir1
      lfs migrate: /mnt/testfs/dir1/hosts migrate failed: Operation not supported (95)
      tests# lfs getstripe -m /mnt/testfs/dir1
      1
      tests# lfs getstripe -m /mnt/testfs/dir1/hosts
      0
      

      So it seems like the directory was migrated, but the mirrored file was not. Is there some reason that the mirrored file could not be migrated? I don't think that should be any different than migrating some other composite file.

      Attachments

        Issue Links

          Activity

            [LU-13424] unable to migrate mirrored files
            pjones Peter Jones added a comment -

            Landed for 2.14

            pjones Peter Jones added a comment - Landed for 2.14

            Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38257/
            Subject: LU-13424 mdt: fix DOM entry check
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 8f6b0aacc0e905bad7aebddfd838cbd610f17483

            gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38257/ Subject: LU-13424 mdt: fix DOM entry check Project: fs/lustre-release Branch: master Current Patch Set: Commit: 8f6b0aacc0e905bad7aebddfd838cbd610f17483

            I've made patch for this issue just to avoid dependencies on alternative patch and to have the example for b2_12 and any other releases

            tappro Mikhail Pershin added a comment - I've made patch for this issue just to avoid dependencies on alternative patch and to have the example for b2_12 and any other releases

            Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38257
            Subject: LU-13424 mdt: fix DOM entry check
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: a5aa82d0908a3c3070d7b7ef58ddc2f1f84af533

            gerrit Gerrit Updater added a comment - Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38257 Subject: LU-13424 mdt: fix DOM entry check Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: a5aa82d0908a3c3070d7b7ef58ddc2f1f84af533

            Patch is simple, just initialize that has_dom with false and it should be fixed in older releases, but I am not sure about master because https://review.whamcloud.com/#/c/38152 fixes that already though in different manner.

            tappro Mikhail Pershin added a comment - Patch is simple, just initialize that has_dom with false and it should be fixed in older releases, but I am not sure about master because https://review.whamcloud.com/#/c/38152 fixes that already though in different manner.

            There is mistake in variable initialization:

            static inline int mdt_lmm_dom_entry(struct lov_mds_md *lmm)
            {
            	struct lov_comp_md_v1 *comp_v1;
            	struct lov_mds_md *v1;
            	__u32 off;
            	bool has_dom = true;
            	               ^^^
             

            Default value should be false, because at the end there is:

            	return has_dom ? LMM_DOM_ONLY : LMM_NO_DOM
            

            So even if DOM stripe wasn't found and has_dom is not set, it is still true by default

            tappro Mikhail Pershin added a comment - There is mistake in variable initialization: static inline int mdt_lmm_dom_entry(struct lov_mds_md *lmm) { struct lov_comp_md_v1 *comp_v1; struct lov_mds_md *v1; __u32 off; bool has_dom = true ; ^^^   Default value should be false , because at the end there is: return has_dom ? LMM_DOM_ONLY : LMM_NO_DOM So even if DOM stripe wasn't found and has_dom is not set, it is still true by default

            I verified that DoM was involved not involved in my test:

            # lfs getstripe /mnt/testfs/dir1/hosts
            /mnt/testfs/dir1/hosts
              lcm_layout_gen:    2
              lcm_mirror_count:  2
              lcm_entry_count:   2
                lcme_id:             65537
                lcme_mirror_id:      1
                lcme_flags:          init
                lcme_extent.e_start: 0
                lcme_extent.e_end:   EOF
                  lmm_stripe_count:  1
                  lmm_stripe_size:   1048576
                  lmm_pattern:       raid0
                  lmm_layout_gen:    0
                  lmm_stripe_offset: 2
                  lmm_objects:
                  - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x1f42:0x0] }
            
                lcme_id:             131073
                lcme_mirror_id:      2
                lcme_flags:          init
                lcme_extent.e_start: 0
                lcme_extent.e_end:   EOF
                  lmm_stripe_count:  1
                  lmm_stripe_size:   1048576
                  lmm_pattern:       raid0
                  lmm_layout_gen:    0
                  lmm_stripe_offset: 3
                  lmm_objects:
                  - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x1f82:0x0] }
            

            so this check shouldn't have anything to do with the inode migration to another MDT. Maybe the check is broken?

            Mike, could you please take a look at this.

            adilger Andreas Dilger added a comment - I verified that DoM was involved not involved in my test: # lfs getstripe /mnt/testfs/dir1/hosts /mnt/testfs/dir1/hosts lcm_layout_gen: 2 lcm_mirror_count: 2 lcm_entry_count: 2 lcme_id: 65537 lcme_mirror_id: 1 lcme_flags: init lcme_extent.e_start: 0 lcme_extent.e_end: EOF lmm_stripe_count: 1 lmm_stripe_size: 1048576 lmm_pattern: raid0 lmm_layout_gen: 0 lmm_stripe_offset: 2 lmm_objects: - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x1f42:0x0] } lcme_id: 131073 lcme_mirror_id: 2 lcme_flags: init lcme_extent.e_start: 0 lcme_extent.e_end: EOF lmm_stripe_count: 1 lmm_stripe_size: 1048576 lmm_pattern: raid0 lmm_layout_gen: 0 lmm_stripe_offset: 3 lmm_objects: - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x1f82:0x0] } so this check shouldn't have anything to do with the inode migration to another MDT. Maybe the check is broken? Mike, could you please take a look at this.
            emoly.liu Emoly Liu added a comment -

            This error is related to the following code in function mdt_reint_migrate():

                    /* TODO: DoM migration is not supported yet */
                    if (S_ISREG(lu_object_attr(&sobj->mot_obj))) {
                            ma->ma_lmm = info->mti_big_lmm;
                            ma->ma_lmm_size = info->mti_big_lmmsize;
                            ma->ma_valid = 0;
                            rc = mdt_stripe_get(info, sobj, ma, XATTR_NAME_LOV);
                            if (rc)
                                    GOTO(put_source, rc);
            
                            if (ma->ma_valid & MA_LOV &&
                                mdt_lmm_dom_entry(ma->ma_lmm) != LMM_NO_DOM)
                                    GOTO(put_source, rc = -EOPNOTSUPP);
                    }
            
            emoly.liu Emoly Liu added a comment - This error is related to the following code in function mdt_reint_migrate(): /* TODO: DoM migration is not supported yet */ if (S_ISREG(lu_object_attr(&sobj->mot_obj))) { ma->ma_lmm = info->mti_big_lmm; ma->ma_lmm_size = info->mti_big_lmmsize; ma->ma_valid = 0; rc = mdt_stripe_get(info, sobj, ma, XATTR_NAME_LOV); if (rc) GOTO(put_source, rc); if (ma->ma_valid & MA_LOV && mdt_lmm_dom_entry(ma->ma_lmm) != LMM_NO_DOM) GOTO(put_source, rc = -EOPNOTSUPP); }

            People

              tappro Mikhail Pershin
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: