Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-16500

"lfs migrate <file>" preserves specific layout too much

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • Lustre 2.16.0
    • None
    • 3
    • 9223372036854775807

    Description

      Running "lfs migrate <file>" without any SETSTRIPE arguments to balance space usage keeps the PFL file layout, but preserves the OST selection "too well". The "lfs migrate" command is intended to be used for space balancing OSTs, so it would be expected to change the starting OST and other OSTs in use to better balance, but the OSTs are preserved exactly and this makes the migration virtually useless in this case:

      # lfs df
      UUID                   1K-blocks        Used   Available Use% Mounted on
      testfs-MDT0000_UUID       125056        2268      111552   2% /mnt/testfs[MDT:0]
      testfs-OST0000_UUID       313104        1664      284280   1% /mnt/testfs[OST:0]
      testfs-OST0001_UUID       313104      206464       79480  73% /mnt/testfs[OST:1]
      testfs-OST0002_UUID       313104        1668      284276   1% /mnt/testfs[OST:2]
      testfs-OST0003_UUID       313104        1668      284276   1% /mnt/testfs[OST:3]
      
      filesystem_summary:      1252416      211464      932312  19% /mnt/testfs
      
      # lfs setstripe -E 1M -c 1 -E 16M -c 1 -E eof -c 1 /mnt/testfs/junk3
      # fallocate -l 17M /mnt/testfs/junk3
      # lfs getstripe /mnt/testfs/junk3 | grep l_ost_idx
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x5d:0x0] }
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0xc1:0x0] }
            - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x22:0x0] }
      # lfs migrate /mnt/testfs/junk3
      # lfs getstripe /mnt/testfs/junk3 | grep l_ost_idx
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x5e:0x0] }
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0xc2:0x0] }
            - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x23:0x0] }
      # lfs migrate /mnt/testfs/junk3
      # lfs getstripe /mnt/testfs/junk3 | grep l_ost_idx
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x5f:0x0] }
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0xc3:0x0] }
            - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x24:0x0] }
      # lfs migrate /mnt/testfs/junk3
      # lfs getstripe /mnt/testfs/junk3 | grep l_ost_idx
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x60:0x0] }
            - 0: { l_ost_idx: 1, l_fid: [0x100010000:0xc4:0x0] }
            - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x25:0x0] }
      

      One would expect with the OST0001 imbalance that it would be skipped for allocation, but the "lfs migrate" command must be using a specific layout. Instead, it should be clearing the specific OST indices from the layout and only using it as a template.

      Creating a new file correctly avoids the full OST, so this isn't a problem with the QOS space balancing:

      # lfs setstripe -E 1M -c 1 -E 16M -c 1 -E eof -c 1 /mnt/testfs/junk3.2
      # fallocate -l 17M /mnt/testfs/junk3.2
      # lfs getstripe /mnt/testfs/junk3.2 | grep l_ost_idx
            - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x62:0x0] }
            - 0: { l_ost_idx: 3, l_fid: [0x100030000:0x5f:0x0] }
            - 0: { l_ost_idx: 2, l_fid: [0x100020000:0x27:0x0] }
      

      Attachments

        Issue Links

          Activity

            [LU-16500] "lfs migrate <file>" preserves specific layout too much
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-13062 [ LU-13062 ]
            pjones Peter Jones made changes -
            Link New: This issue is related to DDN-5322 [ DDN-5322 ]
            adilger Andreas Dilger made changes -
            Link New: This issue is related to LU-15834 [ LU-15834 ]
            pjones Peter Jones made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Merged for 2.16

            pjones Peter Jones added a comment - Merged for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/54600/
            Subject: LU-16500 utils: 'lfs migrate' should select new OSTs
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 2007ab4709acaef0397df15c9f4cf4387844ba9c

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/54600/ Subject: LU-16500 utils: 'lfs migrate' should select new OSTs Project: fs/lustre-release Branch: master Current Patch Set: Commit: 2007ab4709acaef0397df15c9f4cf4387844ba9c
            adilger Andreas Dilger made changes -
            Link New: This issue is duplicated by LU-17697 [ LU-17697 ]

            "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54600
            Subject: LU-16500 utils: 'lfs migrate' should select new OSTs
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 5bba268af1ba040aa29f666baf8c958028c2e1a8

            gerrit Gerrit Updater added a comment - "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/54600 Subject: LU-16500 utils: 'lfs migrate' should select new OSTs Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 5bba268af1ba040aa29f666baf8c958028c2e1a8
            adilger Andreas Dilger made changes -
            Resolution Original: Fixed [ 1 ]
            Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

            The landed patch didn't totally fix the problem. For files with multiple components, running "lfs migrate FILE" repeatedly on the same file only changes the last component of the file, because llapi_layout_ost_index_set() is only changing cur_comp.

            I will push a patch to reset the OST index for all components of the file.

            adilger Andreas Dilger added a comment - The landed patch didn't totally fix the problem. For files with multiple components, running " lfs migrate FILE " repeatedly on the same file only changes the last component of the file, because llapi_layout_ost_index_set() is only changing cur_comp . I will push a patch to reset the OST index for all components of the file.

            People

              yujian Jian Yu
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: