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

readdir of a migrating striped directory lists names twice or misses them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • Lustre 2.18.0
    • None
    • 3
    • 9223372036854775807

      While a striped directory is being auto-split or migrated, a readdir on a client can return the same name twice, once from the old stripe and once from the new stripe.

      LMV reads each stripe in its own RPC and merges the pages by hash in lmv_striped_read_page() and lmv_dirent_next(). It never compares names. If a name is read from the old stripe before it moves and from the new stripe after it moves, it is listed twice.

      Impact

      A tool that processes the names in parallel fails on the second copy. For example:

      lfs find -type f -print0 DIR | xargs -0rP 16 -n 1 rm

      fails with:

      rm: cannot remove '...': No such file or directory

      No data is lost. The failure comes from deleting the same name twice.

      How to confirm

      Check the listing for duplicate names while the directory is migrating:

      lfs find --threads=4 -type f $TestDir | sort | uniq -d

      Any output is a name that was listed more than once. The migrating flag in lfs getdirstripe $TestDir shows whether a migration is in progress.

            manhongdai Manhong Dai
            manhongdai Manhong Dai
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: