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

'lfs mirror extend' should allow specifying total mirror count

Details

    • 9223372036854775807

    Description

      The "lfs mirror extend" command with the "-N" option today takes a count of the number of mirrors to add to a file, but there is no way to specify the total number of mirrors to create on a file. This can be problematic if there are multiple threads running e.g. "lfs mirror extend -N 1" on the same file, or if the command has an error and is retried, as it may incorrectly result in 3 or more mirrors being created on the file.

      It would be desirable to have an option that specifies to create the total number of mirrors on the file, and this is a no-op if that number of mirrors already exists. It is open for discussion whether this should also reduce the number of mirrors on a file if there are more, and if so how it would select which mirror to remove.

      Attachments

        Issue Links

          Activity

            [LU-16446] 'lfs mirror extend' should allow specifying total mirror count

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/57391/
            Subject: LU-16446 utils: fix issues with llapi_get_lmm_from_path()
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: bed10bb93399971f27295069d82a046cb0995b9a

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/57391/ Subject: LU-16446 utils: fix issues with llapi_get_lmm_from_path() Project: fs/lustre-release Branch: master Current Patch Set: Commit: bed10bb93399971f27295069d82a046cb0995b9a

            "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/57391
            Subject: LU-16446 fixes: fix type for lmmlen in liblustreapi
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 8b7af7697e78e08dbc3924c6353111736aecf575

            gerrit Gerrit Updater added a comment - "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/57391 Subject: LU-16446 fixes: fix type for lmmlen in liblustreapi Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 8b7af7697e78e08dbc3924c6353111736aecf575
            pjones Peter Jones added a comment -

            Merged for 2.17

            pjones Peter Jones added a comment - Merged for 2.17

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55867/
            Subject: LU-16446 utils: specify total count for mirror extend
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: a796b10fa2609af6ab1869a04ea6cc6c2c9051ec

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55867/ Subject: LU-16446 utils: specify total count for mirror extend Project: fs/lustre-release Branch: master Current Patch Set: Commit: a796b10fa2609af6ab1869a04ea6cc6c2c9051ec

            It would be possible to extend this functionality to allow forcing a mirror to be created on a specific target pool of it is specified with "lfs mirror extend -N=2 --pool==slow FILE" so that one mirror will be created on the slow pool if it doesn't exist.

            adilger Andreas Dilger added a comment - It would be possible to extend this functionality to allow forcing a mirror to be created on a specific target pool of it is specified with " lfs mirror extend -N=2 --pool==slow FILE " so that one mirror will be created on the slow pool if it doesn't exist.
            aioffe Alexandre Ioffe added a comment - - edited

            I have a question regarding using this feature with multiple pools.

            How it could improve this usage?

            This counter disregards pool information. We could not use it if we want to limit number of copies in a specific pool. For example, we want to have exactly one copy in each fast pool and in slow pool. But if the customer had created a second copy in a third pool (let call it a "back-up" pool), command

            lfs mirror extend -N=2 --pool='slow'

            will have no effect

            aioffe Alexandre Ioffe added a comment - - edited I have a question regarding using this feature with multiple pools. How it could improve this usage? This counter disregards pool information. We could not use it if we want to limit number of copies in a specific pool. For example, we want to have exactly one copy in each fast pool and in slow pool. But if the customer had created a second copy in a third pool (let call it a "back-up" pool), command lfs mirror extend -N=2 --pool= 'slow' will have no effect –

            "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55867
            Subject: LU-16446 utils: specify total count mirror extend
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 6bc9210ce739bdeef6c237704049f9ea83c86d2f

            gerrit Gerrit Updater added a comment - "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55867 Subject: LU-16446 utils: specify total count mirror extend Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 6bc9210ce739bdeef6c237704049f9ea83c86d2f

            It looks like it would be possible to use "lfs mirror extend -N =COUNT SETSTRIPE_OPTS FILE" or "lfs mirror extend --mirror-count==COUNT SETSTRIPE_OPTS FILE" to specify having exactly COUNT mirrors on a file. It should be possible to run this on files that already have COUNT mirrors and it would be a no-op.

            I'm uncertain whether -N COUNT could/should remove excess mirrors already existing on a file.

            • it would be convenient if there was some simple way to make files "consistent" regardless of whether they currently have more or fewer mirrors
            • however, the command is named "mirror extend" so it might be confusing to users if it is reducing the number of mirrors
            • it also isn't clear how this would select mirror(s) to remove if there are additional ones existing? One option might be to remove only additional mirrors that match the SETSTRIPE_OPTS specified on the command-line, with the assumption that those are the "extra" mirrors

            It would be desirable to have a command to use for filesystem maintenance to run against a whole directory tree to bring all of the files to a consistent state. The problem of "lfs mirror extend -N COUNT" creating excess mirrors is somewhat "self healing" over time as users/tools move to use "-N =COUNT" to create mirrors, and files with excess mirrors are eventually deleted. However, it might be better to have a different command like "lfs mirror delete -N =COUNT" or similar that would reduce the number of mirrors on a file to exactly COUNT, along with a way to specify which mirrors to remove.

            For example, "lfs mirror delete -N =2" would leave a file with exactly two mirrors, if the mirrors are "symmetrical" and it doesn't matter which one(s) are kept (maybe with some smarts to ensure the two remaining mirrors do not have components on overlapping OSTs). Something like "lfs mirror delete -N =1 --pool ssd -N =1 --pool hdd" could leave exactly one mirror on each of the ssd and hdd pools. This is just an initial idea at this point, and open for discussion for the best way to be able to specify such operations.

            adilger Andreas Dilger added a comment - It looks like it would be possible to use " lfs mirror extend -N =COUNT SETSTRIPE_OPTS FILE " or " lfs mirror extend --mirror-count==COUNT SETSTRIPE_OPTS FILE " to specify having exactly COUNT mirrors on a file. It should be possible to run this on files that already have COUNT mirrors and it would be a no-op. I'm uncertain whether -N COUNT could/should remove excess mirrors already existing on a file. it would be convenient if there was some simple way to make files "consistent" regardless of whether they currently have more or fewer mirrors however, the command is named " mirror extend " so it might be confusing to users if it is reducing the number of mirrors it also isn't clear how this would select mirror(s) to remove if there are additional ones existing? One option might be to remove only additional mirrors that match the SETSTRIPE_OPTS specified on the command-line, with the assumption that those are the "extra" mirrors It would be desirable to have a command to use for filesystem maintenance to run against a whole directory tree to bring all of the files to a consistent state. The problem of " lfs mirror extend -N COUNT " creating excess mirrors is somewhat "self healing" over time as users/tools move to use " -N =COUNT " to create mirrors, and files with excess mirrors are eventually deleted. However, it might be better to have a different command like " lfs mirror delete -N =COUNT " or similar that would reduce the number of mirrors on a file to exactly COUNT , along with a way to specify which mirrors to remove. For example, " lfs mirror delete -N =2 " would leave a file with exactly two mirrors, if the mirrors are "symmetrical" and it doesn't matter which one(s) are kept (maybe with some smarts to ensure the two remaining mirrors do not have components on overlapping OSTs). Something like " lfs mirror delete -N =1 --pool ssd -N =1 --pool hdd " could leave exactly one mirror on each of the ssd and hdd pools. This is just an initial idea at this point, and open for discussion for the best way to be able to specify such operations.

            People

              fdilger Fred Dilger
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: