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

Non-unique file names in a striped dir after migration

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      There is a way to get name duplicates in a striped dir:

      Suppose an app  either have a CWD in some plain dir or have an open file descriptor for that dir.
      After that, the dir is being migrated and has converted to a striped form for performing the migration.

      The initial plain dir is now a stripe of the striped dir, and the app still has a possibility to create objects in the that stripe
      not caring about uniqueness of the file names across the whole striped dir.

      Here is an example:

      Session1: creating a test dir:

      [root@rocky ~]# mkdir /mnt/lustre/testdir
      [root@rocky ~]# 
      

      Session2: in another session changing working directory to /mnt/lustre/testdir:

      [root@rocky ~]# cd /mnt/lustre/testdir/
      [root@rocky testdir]# 
      

      Session1: starting and interrupting dir migration (using gdb):

      touch /mnt/lustre/testdir/foo-{01..20}
      LD_LIBRARY_PATH=$PWD/../utils/.libs/:$PWD/../../lnet/utils/.libs/:$PWD/../../lnet/utils/lnetconfig/.libs gdb ../utils/.libs/lfs << EOF
      break llapi_migrate_mdt
      run migrate -m 1 /mnt/lustre/testdir
      break cb_migrate_mdt_init
      continue
      continue
      continue
      continue
      continue
      continue
      continue
      continue
      EOF
      ....
      
      [root@rocky tests]# ../utils/lfs getdirstripe /mnt/lustre/testdir/
      lmv_stripe_count: 2 lmv_stripe_offset: 1 lmv_hash_type: crush,migrating
      mdtidx		 FID[seq:oid:ver]
           1		 [0x240002341:0x6:0x0]		
           1		 [0x240002340:0x1f:0x0]		
      [root@rocky tests]# 
      

      Session1: creating a subdir :

      [root@rocky tests]# mkdir /mnt/lustre/testdir/a_duplicated_dir
      [root@rocky tests]# 
      

      in another session, doing the same
      Session2:

      [root@rocky testdir]# mkdir a_duplicated_dir
      [root@rocky testdir]# 
      

      in Session1, checking the result:

      [root@rocky tests]# ls -l /mnt/lustre/testdir/
      total 8
      drwxr-xr-x 2 root root 4096 Mar 20 22:01 a_duplicated_dir
      drwxr-xr-x 2 root root 4096 Mar 20 22:01 a_duplicated_dir
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-01
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-02
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-03
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-04
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-05
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-06
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-07
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-08
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-09
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-10
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-11
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-12
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-13
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-14
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-15
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-16
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-17
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-18
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-19
      -rw-r--r-- 1 root root    0 Mar 20 21:59 foo-20
      [root@rocky tests]# 

      Attachments

        Activity

          People

            wc-triage WC Triage
            zam Alexander Zarochentsev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: