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

add 'lfs find' parameter to return only a fraction of files for rebalancing

Details

    • 3
    • 9223372036854775807

    Description

      When migrating files from existing OSTs to newly-added OSTs, it would be convenient to have a parameter like "lfs find ... --skip NN" that only returned the requested percentage of all files found, rather than every file. That would have the benefit of allowing, say, 50% of existing files in the scanned directory tree to be migrated to the new OSTs (if the filesystem capacity was doubled), instead of migrating 100% of files from one directory tree (until the target OSTs are in balance), and 0% of files from remaining directories.

      Moving a only a fraction of the files in each subdirectory would better balance (and improve) the read workload for existing directories across all OSTs rather than moving some directories wholesale to the new OSTs and leaving other directories entirely on the old OSTs.

      Consider a filesystem with 40 OSTs that are 90% full, and 20 new OSTs of equal size are added (that are initially 0% full). The existing OSTs have about 40 * 0.9 = 36 full OSTs worth of data. If the filesystem had started with 60 OSTs from the beginning then the OSTs would be 36 OSTs / 60 OSTs = 60% full, which is the target to rebalance the new OSTs. That means we want to migrate 90% - 60% = 30% of the existing OST space, so it would be desirable to migrate approximately "30% / 90% = 1/3 = 33%" of all files (use "--skip=67"), or ideally a fraction subset of files that compose 33% of the space on each OST.

      Specifying the "-skip NN" percentage isn't perfect, since returning only a fraction of filenames may not balance the total space usage (e.g. if the other "lfs find" parameters exclude files that make up a large fraction of space, or the filename sampling somehow aliases with the filenames badly, like "-find 50" returning only small files from "file0000.small, file0000.big, file0001.small, file0001.big), but it can provide a reasonable first estimate that would work for many cases.

      Potentially a further enhancement instead of directly specifying the "-skip" percentage (which the user would have to calculate themselves) would be something like "lfs find --skip-rebalance ..." that calculated the actual percentage of files that needed to be returned vs. skipped based on the fullness ratio of each OST vs. the average fullness of a balanced filesystem, so that it would return files from OSTs where ost_size * filesystem_percent_used > ost_used, not return any files on (presumably new) OSTs with usage below filesystem_percent_used and the fraction of files returned from each OST depends on how far from the filesystem average each OST is. This would be more complex to implement, but probably more useful in the end, though I think "-skip" by itself would be a useful starting point.

      Attachments

        Issue Links

          Activity

            [LU-17699] add 'lfs find' parameter to return only a fraction of files for rebalancing
            pjones Peter Jones added a comment -

            Merged for 2.16

            pjones Peter Jones added a comment - Merged for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55200/
            Subject: LU-17699 utils: new --skip option for lfs find
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 3abd26f36c82da57645a79d56b3c7446fad01a70

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/55200/ Subject: LU-17699 utils: new --skip option for lfs find Project: fs/lustre-release Branch: master Current Patch Set: Commit: 3abd26f36c82da57645a79d56b3c7446fad01a70

            "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55200
            Subject: LU-17699 utils: new --skip option for lfs find
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: f5ef372fae1614210ba2fb28479e4f9f40e8e146

            gerrit Gerrit Updater added a comment - "Frederick Dilger <fdilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/55200 Subject: LU-17699 utils: new --skip option for lfs find Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: f5ef372fae1614210ba2fb28479e4f9f40e8e146

            The option parsing would be done in lfs_find() and the "find percentage" stored at the end of find_params and checked right before the filename or directory is printed at the end of cb_find_init() at the print: label. The randomness doesn't need to be very strong, and having it be repeatable across multiple runs (with the same list of files as input) might be desirable, so using the standard random() function is probably OK in this case.

            adilger Andreas Dilger added a comment - The option parsing would be done in lfs_find() and the "find percentage" stored at the end of find_params and checked right before the filename or directory is printed at the end of cb_find_init() at the print: label. The randomness doesn't need to be very strong, and having it be repeatable across multiple runs (with the same list of files as input) might be desirable, so using the standard random() function is probably OK in this case.

            People

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

              Dates

                Created:
                Updated:
                Resolved: