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

'lfs migrate --block' does not block modifications

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.17.0
    • Lustre 2.14.0, Lustre 2.16.1
    • None
    • 3
    • 9223372036854775807

    Description

      The "lfs migrate --block FILE" command appears to be broken, since it does not block other processes from modifying a file during migration, and instead returns an error:

      $ dd if=/dev/urandom of=/myth/tmp/random bs=1 oflag=sync &
      $ lfs migrate -c2 --block /myth/tmp/random
      error: lfs migrate: /myth/tmp/random: file changed: Resource temporarily unavailable
      $ lfs migrate -c2 --block /myth/tmp/random
      error: lfs migrate: /myth/tmp/random: file changed: Resource temporarily unavailable
      

      This is likely due to the use of a lease to be notified of the file modification during migration. Previously, "lfs migrate --block" was using a group lock to block other clients from accessing the file during migration.

      The "lfs migrate --block" command is important for OST evacuation, because it is the "last resort" mechanism to move files off an OST before it is removed from service. This needs to complete even if there is an application that is writing to the file, though the application writing to the file will block until the migration is complete.

      Attachments

        Issue Links

          Activity

            [LU-18758] 'lfs migrate --block' does not block modifications
            pjones Peter Jones added a comment -

            Merged for 2.17

            pjones Peter Jones added a comment - Merged for 2.17
            gerrit Gerrit Updater added a comment -

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58299/
            Subject: LU-18758 tests: test lfs migrate --block on changing file
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 4794fcd61a25fe32f0c6f162049983961d01307a

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58299/ Subject: LU-18758 tests: test lfs migrate --block on changing file Project: fs/lustre-release Branch: master Current Patch Set: Commit: 4794fcd61a25fe32f0c6f162049983961d01307a

            "Feng Lei <flei@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58299
            Subject: LU-18758 tests: test lfs migrate --block on changing file
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 0950d59a3e40a20ee47c49f9711112572df4a347

            gerrit Gerrit Updater added a comment - "Feng Lei <flei@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58299 Subject: LU-18758 tests: test lfs migrate --block on changing file Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 0950d59a3e40a20ee47c49f9711112572df4a347
            flei Feng Lei added a comment - - edited

            The test passes too with oflag=sync flag:

            # dd if=/dev/zero of=random bs=1 oflag=sync &
            [1] 2692411
            # lfs migrate -o 0 --block random
            # lfs migrate -c 2 --block random
            # kill 2692411
            # 
            [1]+  Terminated              dd if=/dev/zero of=random bs=1 oflag=sync 

            Please correct me if there is any mistake.

            flei Feng Lei added a comment - - edited The test passes too with oflag=sync flag: # dd if=/dev/zero of=random bs=1 oflag=sync & [1] 2692411 # lfs migrate -o 0 --block random # lfs migrate -c 2 --block random # kill 2692411 #  [1]+  Terminated              dd if=/dev/zero of=random bs=1 oflag=sync Please correct me if there is any mistake.
            flei Feng Lei added a comment -

            Looks like it has been fixed in latest version.

            # lctl version 
            lt-lctl 2.16.52_30_g8cd8f3f
            # dd if=/dev/zero of=random bs=1 &
            [1] 2692265
            # lfs migrate -o 0 --block random
            # kill 2692265
            # 
            [1]+  Terminated              dd if=/dev/zero of=random bs=1
            # lfs getstripe random
            random
            lmm_stripe_count:  1
            lmm_stripe_size:   4194304
            lmm_pattern:       raid0
            lmm_layout_gen:    1
            lmm_stripe_offset: 0
            	obdidx		 objid		 objid		 group
            	     0	          1869	        0x74d	   0x240000400
            
            # ls -l random
            -rw-r--r-- 1 root root 80966 Mar  4 14:09 random
            
            flei Feng Lei added a comment - Looks like it has been fixed in latest version. # lctl version lt-lctl 2.16.52_30_g8cd8f3f # dd if=/dev/zero of=random bs=1 & [1] 2692265 # lfs migrate -o 0 --block random # kill 2692265 # [1]+ Terminated dd if=/dev/zero of=random bs=1 # lfs getstripe random random lmm_stripe_count: 1 lmm_stripe_size: 4194304 lmm_pattern: raid0 lmm_layout_gen: 1 lmm_stripe_offset: 0 obdidx objid objid group 0 1869 0x74d 0x240000400 # ls -l random -rw-r--r-- 1 root root 80966 Mar 4 14:09 random

            It would also be useful to add an alias "--nonblock" in addition to "--non-block" for ease of use.

            adilger Andreas Dilger added a comment - It would also be useful to add an alias " --nonblock " in addition to " --non-block " for ease of use.

            People

              flei Feng Lei
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: