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

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

    XMLWordPrintable

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: