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

Data lost after migrate striped dir

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Lustre 2.12.0
    • Fix Version/s: Lustre 2.12.0
    • Labels:
      None
    • Environment:
      server and client are 2.11.56 . tag-2.11.56_55_g4afee32
    • Severity:
      3
    • Rank (Obsolete):
      9223372036854775807

      Description

      system setup as 2 MDS with 2 MDTs on each, 1 OSS with 1 OST, zfs as underline fs. 1 client .

      test steps:
      1. make striped dir cross MDT0 and MDT1 on MDS1
      2. touch a file and write some data
      3. migrate the dir to MDT1 and MDT3 successful
      4. check the data and it lost.

      [root@trevis-60vm7 lustre]# lfs mkdir -c 2 -i 0 test
      [root@trevis-60vm7 lustre]# lfs getdirstripe test
      lmv_stripe_count: 2 lmv_stripe_offset: 0 lmv_hash_type: fnv_1a_64
      mdtidx		 FID[seq:oid:ver]
           0		 [0x200000400:0x6:0x0]		
           1		 [0x240000401:0x6:0x0]		
      [root@trevis-60vm7 lustre]# cd test/
      [root@trevis-60vm7 test]# touch foo
      [root@trevis-60vm7 test]# echo abcd > foo
      [root@trevis-60vm7 test]# cat foo
      abcd
      [root@trevis-60vm7 test]# cd ..
      [root@trevis-60vm7 lustre]# ls -al test/
      total 34
      drwxr-xr-x 2 root root 22528 Nov  8 01:29 .
      drwxr-xr-x 4 root root 10752 Nov  8 01:29 ..
      -rw-r--r-- 1 root root     5 Nov  8 01:29 foo
      [root@trevis-60vm7 lustre]# lfs migrate -m 1,3 test/
      [root@trevis-60vm7 lustre]# lfs getdirstripe test
      lmv_stripe_count: 2 lmv_stripe_offset: 1 lmv_hash_type: fnv_1a_64
      mdtidx		 FID[seq:oid:ver]
           1		 [0x240000400:0x6:0x0]		
           3		 [0x2c0000402:0x6:0x0]		
      [root@trevis-60vm7 lustre]# ls -al test/
      total 33
      drwxr-xr-x 2 root root 22528 Nov  8 01:29 .
      drwxr-xr-x 4 root root 10752 Nov  8 01:30 ..
      -rw-r--r-- 1 root root     0 Nov  8 01:29 foo
      [root@trevis-60vm7 lustre]# cat test/foo 
      [root@trevis-60vm7 lustre]# 
      

      5. create another file with data under test dir, the dir is cross MDT1, and MDT3 right now
      6. migrate the dir back to MDT0 and MDT1
      7. check the new file and data is still there

      [root@trevis-60vm7 lustre]# cd test/
      [root@trevis-60vm7 test]# touch foo-2
      [root@trevis-60vm7 test]# echo 1234 > foo-2 
      [root@trevis-60vm7 test]# cat foo-2 
      1234
      [root@trevis-60vm7 test]# ls -al
      total 34
      drwxr-xr-x 2 root root 22528 Nov  8 01:31 .
      drwxr-xr-x 4 root root 10752 Nov  8 01:30 ..
      -rw-r--r-- 1 root root     0 Nov  8 01:29 foo
      -rw-r--r-- 1 root root     5 Nov  8 01:31 foo-2
      [root@trevis-60vm7 test]# cd ..
      [root@trevis-60vm7 lustre]# lfs migrate -m 0,1 test/
      [root@trevis-60vm7 lustre]# lfs getdirstripe test/
      lmv_stripe_count: 2 lmv_stripe_offset: 0 lmv_hash_type: fnv_1a_64
      mdtidx		 FID[seq:oid:ver]
           0		 [0x200000400:0x7:0x0]		
           1		 [0x240000401:0x7:0x0]		
      [root@trevis-60vm7 lustre]# ls -al test/
      total 39
      drwxr-xr-x 2 root root 22528 Nov  8 01:31 .
      drwxr-xr-x 4 root root 10752 Nov  8 01:31 ..
      -rw-r--r-- 1 root root     0 Nov  8 01:29 foo
      -rw-r--r-- 1 root root     5 Nov  8 01:31 foo-2
      [root@trevis-60vm7 lustre]# cat foo-2
      cat: foo-2: No such file or directory
      [root@trevis-60vm7 lustre]# cat test/foo-2 
      1234
      [root@trevis-60vm7 lustre]# 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                laisiyao Lai Siyao
                Reporter:
                sarah Sarah Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: