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

Use migrate_copy_data() for all data movement

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      The "lfs mirror resync" code is using its own implementation of data copying instead of migrate_copy_data(), which means that bug fixes and improvements to the data copying code (eg. bandwidth limit, stats reporting, buffer sizing, DIO usage, etc.) need to be implemented in two places.

      It would be better to have a single function to copy file data shared between the different operations.

      Attachments

        Issue Links

          Activity

            [LU-17143] Use migrate_copy_data() for all data movement
            flei Feng Lei added a comment -

            Not able to optimize 'lfs mirror resync'.

            'lfs mirror resync' command reads data from the default mirror, and writes to (multiple) stale mirror(s). The fd is protected with a lease lock to detect whether the file is changed during resyncing. This means only 1 fd can be written to during the resyncing, or the lease lock will be lost. So:

            • We cannot write to multiple mirrors by open the file for multiple times and set different mirror id for them.
            • If we want to read data once and write to multiple stale mirrors by set/clear mirror id, it is hard to control the set/clear action precisely for each request because many requests are sharing the same fd. But if we control the mirror id for each batch of requests, I'm not confident that the performance can be improved.
            • Another way is to resync one stale mirror as a whole, then resync another stale mirror as a whole. For 2-mirror file it works well. But for N-mirrors file, we may need to read the file for (N-1) times. Hard to say this is an optimization.
            flei Feng Lei added a comment - Not able to optimize 'lfs mirror resync'. 'lfs mirror resync' command reads data from the default mirror, and writes to (multiple) stale mirror(s). The fd is protected with a lease lock to detect whether the file is changed during resyncing. This means only 1 fd can be written to during the resyncing, or the lease lock will be lost. So: We cannot write to multiple mirrors by open the file for multiple times and set different mirror id for them. If we want to read data once and write to multiple stale mirrors by set/clear mirror id, it is hard to control the set/clear action precisely for each request because many requests are sharing the same fd. But if we control the mirror id for each batch of requests, I'm not confident that the performance can be improved. Another way is to resync one stale mirror as a whole, then resync another stale mirror as a whole. For 2-mirror file it works well. But for N-mirrors file, we may need to read the file for (N-1) times. Hard to say this is an optimization.

            migrate_copy_data is by far the most complex of the various copy functions, so we should start there, though it doesn't have any parallelism in it.

            paf0186 Patrick Farrell added a comment - migrate_copy_data is by far the most complex of the various copy functions, so we should start there, though it doesn't have any parallelism in it.

            People

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

              Dates

                Created:
                Updated: