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

DNE Striped Directory - Changing default striping only works on MDT0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.6.0
    • Lustre 2.6.0
    • Lustre master on CentOS clients and servers. Commit: Idcfb918e0d4e203ff0f9c6d838a68b1a204ee3bd (One commit behind current head.)
    • 3
    • 13361

    Description

      I've been doing some simple testing of the new DNE striped directories, and I'm seeing some strangely inconsistent behavior. This system has 2 MDSes, and 2 MDTs per MDS. Clients and servers are all running master as described in "Environment".

      Apologies in advance for the lengthy description, it takes a while to make the problem clear/show proof.

      I'm seeing inconsistencies when I change the default stripe of a directory.

      Create a striped directory, then set the default striping. Everything, at this point, works fine. All directories created get the correct striping:

      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/{test1,test2,test3,test4,test5,test6,test7,test8,test9,test10,test11,test12}
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12
      test1
      lmv_stripe_count: 4
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d534:0x0]		
           1		 [0x640000400:0x1b:0x0]		
           2		 [0x680000400:0x1b:0x0]		
           3		 [0x6c0000400:0x1b:0x0]		
      
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0x21:0x0]		
           0		 [0x600000403:0x19:0x0]		
           2		 [0x680000403:0x19:0x0]		
           3		 [0x6c0000402:0x19:0x0]		
      
      test3
      lmv_stripe_count: 4
      lmv_stripe_offset: 2
      mdtidx		 FID[seq:oid:ver]
           2		 [0x680000402:0x1aa32:0x0]		
           0		 [0x600000404:0x39:0x0]		
           1		 [0x640000402:0x39:0x0]		
           3		 [0x6c0000403:0x39:0x0]		
      
      test4
      lmv_stripe_count: 4
      lmv_stripe_offset: 3
      mdtidx		 FID[seq:oid:ver]
           3		 [0x6c0000401:0x9e:0x0]		
           0		 [0x600000405:0x2d:0x0]		
           1		 [0x640000403:0x2d:0x0]		
           2		 [0x680000404:0x2d:0x0]		
      

      All the directories are created with the correct striping information set.

      The problems come in when I start changing the default striping. This only seems to work on MDT0.

      Note the hash function (see output above) puts test1 on MDT0, test2 on MDT1, test3 on MDT2, and test4 on MDT3, which is handy for showing this bug.

      If no subdirectories have been created before changing the default striping, everything works just fine:

      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/{test1,test2,test3,test4}
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe test1 test2 test3 test4
      test1
      lmv_stripe_count: 1
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d709:0x0]		
      
      test2
      lmv_stripe_count: 1
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0x95:0x0]		
      
      test3
      lmv_stripe_count: 1
      lmv_stripe_offset: 2
      mdtidx		 FID[seq:oid:ver]
           2		 [0x680000402:0x1aa35:0x0]		
      
      test4
      lmv_stripe_count: 1
      lmv_stripe_offset: 3
      mdtidx		 FID[seq:oid:ver]
           3		 [0x6c0000401:0xa1:0x0]		
      
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# rm -rf *
      

      Changing the default striping after a subdirectory has been created only seems to work on MDT0.

      Here's all four directories at once:

      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/{test1,test2,test3,test4}
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe test1 test2 test3 test4
      test1
      lmv_stripe_count: 4
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d735:0x0]		
           1		 [0x640000400:0x8f:0x0]		
           2		 [0x680000400:0x8f:0x0]		
           3		 [0x6c0000400:0x8f:0x0]		
      
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0xa5:0x0]		
           0		 [0x600000403:0x62:0x0]		
           2		 [0x680000403:0x62:0x0]		
           3		 [0x6c0000402:0x62:0x0]		
      
      test3
      lmv_stripe_count: 4
      lmv_stripe_offset: 2
      mdtidx		 FID[seq:oid:ver]
           2		 [0x680000402:0x1aa3c:0x0]		
           0		 [0x600000404:0x40:0x0]		
           1		 [0x640000402:0x40:0x0]		
           3		 [0x6c0000403:0x40:0x0]		
      
      test4
      lmv_stripe_count: 4
      lmv_stripe_offset: 3
      mdtidx		 FID[seq:oid:ver]
           3		 [0x6c0000401:0xa5:0x0]		
           0		 [0x600000405:0x33:0x0]		
           1		 [0x640000403:0x33:0x0]		
           2		 [0x680000404:0x33:0x0]		
      
      [root@centclient02 striped_directory]# rm -rf *
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/{test1,test2,test3,test4}
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe test1 test2 test3 test4
      test1
      lmv_stripe_count: 1
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d738:0x0]		
      
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0xa6:0x0]		
           0		 [0x600000403:0x63:0x0]		
           2		 [0x680000403:0x63:0x0]		
           3		 [0x6c0000402:0x63:0x0]		
      
      test3
      lmv_stripe_count: 4
      lmv_stripe_offset: 2
      mdtidx		 FID[seq:oid:ver]
           2		 [0x680000402:0x1aa3d:0x0]		
           0		 [0x600000404:0x41:0x0]		
           1		 [0x640000402:0x41:0x0]		
           3		 [0x6c0000403:0x41:0x0]		
      
      test4
      lmv_stripe_count: 4
      lmv_stripe_offset: 3
      mdtidx		 FID[seq:oid:ver]
           3		 [0x6c0000401:0xa6:0x0]		
           0		 [0x600000405:0x34:0x0]		
           1		 [0x640000403:0x34:0x0]		
           2		 [0x680000404:0x34:0x0]		
      

      Here's the directories by themselves. Here's test1, on MDT0:

      [root@centclient02 centssm1]# DIR=test1
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test1
      lmv_stripe_count: 4
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d70d:0x0]		
           1		 [0x640000400:0x80:0x0]		
           2		 [0x680000400:0x80:0x0]		
           3		 [0x6c0000400:0x80:0x0]		
      
      [root@centclient02 striped_directory]# rm -rf *
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test1
      lmv_stripe_count: 1
      lmv_stripe_offset: 0
      mdtidx		 FID[seq:oid:ver]
           0		 [0x600000402:0x1d70f:0x0]	
      

      But here's test2, which goes on MDT1:

      [root@centclient02 centssm1]# DIR=test2
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0x9d:0x0]		
           0		 [0x600000403:0x5a:0x0]		
           2		 [0x680000403:0x5a:0x0]		
           3		 [0x6c0000402:0x5a:0x0]		
      
      [root@centclient02 striped_directory]# rm -rf *
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0x9e:0x0]		
           0		 [0x600000403:0x5b:0x0]		
           2		 [0x680000403:0x5b:0x0]		
           3		 [0x6c0000402:0x5b:0x0]		
      

      We see the same results for test3 on MDT2, and test4 on MDT3.

      Also note that it's creating any directory that goes on the particular MDT - It's not limited to being the same directory, as we can see from this example - test6 and test2 both go on MDT1:

      [root@centclient02 centssm1]# DIR=test6
      [root@centclient02 centssm1]# DIR2=test2
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test6
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0x9f:0x0]		
           0		 [0x600000403:0x5c:0x0]		
           2		 [0x680000403:0x5c:0x0]		
           3		 [0x6c0000402:0x5c:0x0]		
      
      [root@centclient02 striped_directory]# rm -rf *
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR2
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR2
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0xa0:0x0]		
           0		 [0x600000403:0x5d:0x0]		
           2		 [0x680000403:0x5d:0x0]		
           3		 [0x6c0000402:0x5d:0x0]		
      
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# rm -rf *
      

      And for additional confirmation, if I create test2 (which goes on MDT1) and then change default striping and create test3 (which goes on MDT2), we don't see the problem:

      [root@centclient02 centssm1]# DIR=test2
      [root@centclient02 centssm1]# DIR2=test3
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 striped_directory
      [root@centclient02 centssm1]# lfs setdirstripe -c 4 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR
      test2
      lmv_stripe_count: 4
      lmv_stripe_offset: 1
      mdtidx		 FID[seq:oid:ver]
           1		 [0x640000401:0xa1:0x0]		
           0		 [0x600000403:0x5e:0x0]		
           2		 [0x680000403:0x5e:0x0]		
           3		 [0x6c0000402:0x5e:0x0]		
      
      [root@centclient02 striped_directory]# rm -rf *
      [root@centclient02 striped_directory]# cd ..
      [root@centclient02 centssm1]# lfs setdirstripe -c 1 -D striped_directory
      [root@centclient02 centssm1]# mkdir -p striped_directory/$DIR2
      [root@centclient02 centssm1]# cd striped_directory/; lfs getdirstripe $DIR2
      test3
      lmv_stripe_count: 1
      lmv_stripe_offset: 2
      mdtidx		 FID[seq:oid:ver]
           2		 [0x680000402:0x1aa3a:0x0]	
      

      When the hash function is changed to "all_char", this behavior continues, but name to MDT mappings change, so we see it for different directories.

      Attachments

        Issue Links

          Activity

            People

              di.wang Di Wang
              paf Patrick Farrell (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: