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

MDT: lease open for remote files (cross open) was broken

Details

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

    Description

      In Lustre, lease open ensure there are only unique opener for a process on a client in the cluster wide. It is used by many places in Lustre such as HSM release, FLR merge/split/resync operations and PCC-RW attach, et, al.

      However, the open for remote files via cross open (mdt_cross_open) does not take any DLM ibits lock and check the open lease on the file on the server side. 

      This historical legacy issue breaks the open lease semantics.

       

      The following test script will fail as the open lease for remote files is broken:

      test_853() {
              local dir1=$DIR/$tdir.1
              local dir2=$DIR/$tdir.2
              local file1=$dir1/$tfile
              local file2=$dir2/$tfile
      
      
              (( MDSCOUNT > 1 )) || skip "Needs at least 2 MDTs"
      
      
              local pid
      
      
              # Generate a remote regular file via rename
              $LFS mkdir -i 0 $dir1 || error "failed to mkdir $dir1"
              $LFS mkdir -i 1 $dir2 || error "failed to mkdir $dir2"
              touch $file1 || error "failed to touch $file1"
              mv $file1 $file2 || error "failed to rename $file1 $file2"
              $LFS getstripe -m $file2 $dir1 $dir2
      
      
              cancel_lru_locks mdc
      
      
              # Test script copied from sanity/test_208.
              echo "==== test 1: verify get lease work"
              $MULTIOP $file2 oO_CREAT:O_RDWR:eRE+eU || error "failed to get lease"
      
      
              echo "==== test 2: verify lease can be broken by upcoming open"
              $MULTIOP $file2 oO_RDWR:eR_E-eUc &
              pid=$!
              sleep 2
              $MULTIOP $file2 oO_RDWR:c
              kill -USR1 $pid && wait $pid || error "break lease error"
      
      
              echo "==== test 3: verify lease can't be granted if an open already exists"
              $MULTIOP $file2 oO_RDWR:_c &
              pid=$!
              sleep 2
              $MULTIOP $file2 oO_RDWR:eReUc && error "apply lease should fail"
              kill -USR1 $pid && wait $pid || error "failed to open file"
      }
      run_test 853 "lease for cross-ref open on remote file should not be broken" 

       

      Attachments

        Activity

          [LU-18050] MDT: lease open for remote files (cross open) was broken

          "Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55800
          Subject: LU-18050 mdt: fix the broken lease open for remote files
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: d146c09ef0d70f0a656348de48c06465c22f048f

          gerrit Gerrit Updater added a comment - "Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55800 Subject: LU-18050 mdt: fix the broken lease open for remote files Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: d146c09ef0d70f0a656348de48c06465c22f048f

          People

            qian_wc Qian Yingjin
            qian_wc Qian Yingjin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: