Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-1187 DNE Phase 1: Remote Directories
  3. LU-2754

rename from MDT1 to MDT0 sometimes appears to succeed but does not

Details

    • Technical task
    • Resolution: Fixed
    • Blocker
    • Lustre 2.4.0
    • Lustre 2.4.0
    • 2.3.60-50-g75ae281
    • 6687

    Description

      Here sys_rename is a trivial program that just calls rename(argv[1], argv[2]) and check for error.

      # export MDSCOUNT=2
      # llmount.sh
      # cd /mnt/lustre
      # find .
      .
      ./.lustre
      # lfs mkdir -i 1 m1
      # echo 0 > f0
      # echo 1 > m1/f1
      # find .
      .
      ./f0
      ./m1
      ./m1/f1
      ./.lustre
      # sys_rename m1/f1 f0
      # find .
      .
      ./f0
      ./m1
      ./.lustre
      # cat f0
      0
      # rm f0
      

      In the same situation I can get a simple rename or rename-onto an existing directory on MDT0 to return succeess but lose the old dir.

      # find .
      .
      ./m1
      ./.lustre
      # mkdir d0
      # mkdir m1/d1
      # touch m1/d1/f1
      # find .
      .
      ./d0
      ./m1
      ./m1/d1
      ./m1/d1/f1
      ./.lustre
      # sys_rename m1/d1 d0
      # find .
      .
      ./d0
      ./m1
      ./.lustre
      #
      

      Rename onto may require several attempts:

      # mkdir d0
      # mkdir m1/d1
      # touch m1/d1/f0
      # find .
      .
      ./d0
      ./m1
      ./m1/d1
      ./m1/d1/f0
      ./.lustre
      # sys_rename m1/d1 d0
      cannot rename `m1/d1' to `d0': Directory not empty
      # sys_rename m1/d1 d0
      cannot rename `m1/d1' to `d0': Directory not empty
      # mkdir d2
      #
      # sys_rename m1/d1 d2
      cannot rename `m1/d1' to `d2': Directory not empty
      # sys_rename m1/d1 d2
      cannot rename `m1/d1' to `d2': Directory not empty
      # find .
      .
      ./d0
      ./d2
      ./m1
      ./m1/d1
      ./m1/d1/f0
      ./.lustre
      # mkdir d3
      # sys_rename m1/d1 d3
      # find .
      .
      ./d0
      ./d2
      ./m1
      ./d3
      ./.lustre
      

      Attachments

        Issue Links

          Activity

            [LU-2754] rename from MDT1 to MDT0 sometimes appears to succeed but does not

            Fixed by Di's #5257.

            jhammond John Hammond added a comment - Fixed by Di's #5257.
            di.wang Di Wang added a comment -

            yes, lfs mkdir is the alias of "lfs setdirstripe -i" in phase I. Currently lfs setdirstripe only support -i now, and in DNE phase II, lfs setstripe will support stripe_count and pool as well.

            di.wang Di Wang added a comment - yes, lfs mkdir is the alias of "lfs setdirstripe -i" in phase I. Currently lfs setdirstripe only support -i now, and in DNE phase II, lfs setstripe will support stripe_count and pool as well.

            I think "lfs mkdir" and "lfs setdirstripe" are aliases? I'm not sure i know what the distinction is myself.

            adilger Andreas Dilger added a comment - I think "lfs mkdir" and "lfs setdirstripe" are aliases? I'm not sure i know what the distinction is myself.

            Thanks for the clarification. Can you also explain whey we have 'lfs mkdir' and 'lfs setdirstripe'? They seem to be the same thing. Is there a plan for their semantics to diverge at some point?

            jhammond John Hammond added a comment - Thanks for the clarification. Can you also explain whey we have 'lfs mkdir' and 'lfs setdirstripe'? They seem to be the same thing. Is there a plan for their semantics to diverge at some point?
            di.wang Di Wang added a comment -

            Btw: I tried this with 5257. It seems the result is correct now.

            [root@testnode tests]# ../utils/lfs getstripe -M /mnt/lustre/test1/f2
            1
            [root@testnode tests]# ../utils/lfs getstripe -M /mnt/lustre/f3
            0
            [root@testnode tests]# ../utils/lfs getstripe -M /mnt/lustre/test1/f2
            1
            [root@testnode tests]# ./multiop /mnt/lustre/f3 N /mnt/lustre/test1/f2
            rename(): Invalid cross-device link

            I will add more test for this. Thanks.

            di.wang Di Wang added a comment - Btw: I tried this with 5257. It seems the result is correct now. [root@testnode tests] # ../utils/lfs getstripe -M /mnt/lustre/test1/f2 1 [root@testnode tests] # ../utils/lfs getstripe -M /mnt/lustre/f3 0 [root@testnode tests] # ../utils/lfs getstripe -M /mnt/lustre/test1/f2 1 [root@testnode tests] # ./multiop /mnt/lustre/f3 N /mnt/lustre/test1/f2 rename(): Invalid cross-device link I will add more test for this. Thanks.
            di.wang Di Wang added a comment -

            lfs rm_entry is used to only deleting name_entry of the remote directory, i.e. the remote directory will become orphan. Usually this will be used to delete the name entry of remote directory, when some MDT is failed and can not go back, i.e. the administrator will use this command to delete the dangling name entry.

            di.wang Di Wang added a comment - lfs rm_entry is used to only deleting name_entry of the remote directory, i.e. the remote directory will become orphan. Usually this will be used to delete the name entry of remote directory, when some MDT is failed and can not go back, i.e. the administrator will use this command to delete the dangling name entry.
            jhammond John Hammond added a comment -

            Would someone please explain what is the use case of 'lfs rm_entry'? I can't seem to find any mention of it in the DNE design documents I've found?

            jhammond John Hammond added a comment - Would someone please explain what is the use case of 'lfs rm_entry'? I can't seem to find any mention of it in the DNE design documents I've found?
            jhammond John Hammond added a comment -

            Indeed, I should have chosen a better title. Otherwise valid renames from MDT0 to MDT1 all returned -EXDEV as expected. But I never got -EXDEV renaming from MDT1 to MDT0.

            jhammond John Hammond added a comment - Indeed, I should have chosen a better title. Otherwise valid renames from MDT0 to MDT1 all returned -EXDEV as expected. But I never got -EXDEV renaming from MDT1 to MDT0.

            John, note that by design, DNE Phase 1 does not support cross-MDT renames. It is supposed to return -EXDEV in this case and expects "mv" and similar tools to handle this by copying the file instead of doing a simple rename.

            That said, it definitely needs to be handled correctly even at the low level, and it looks like you've found a problem here.

            adilger Andreas Dilger added a comment - John, note that by design, DNE Phase 1 does not support cross-MDT renames. It is supposed to return -EXDEV in this case and expects "mv" and similar tools to handle this by copying the file instead of doing a simple rename. That said, it definitely needs to be handled correctly even at the low level, and it looks like you've found a problem here.
            di.wang Di Wang added a comment - This needs http://review.whamcloud.com/#change,5257 as well.

            People

              di.wang Di Wang
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: