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

Add layout lock for striped directories.

Details

    • Improvement
    • Resolution: Won't Do
    • Major
    • None
    • Lustre 2.8.0
    • 9223372036854775807

    Description

      Currently DNE2 doesn't handle layout locks to revoke the layout if it is changed. When performing an migration on a striped directory the layout lock needs to be invalidated so the client can refresh the layout.

      Attachments

        Issue Links

          Activity

            [LU-7357] Add layout lock for striped directories.
            laisiyao Lai Siyao added a comment -

            Andreas, yes, https://review.whamcloud.com/10110 can be abandoned and this can be closed.

            laisiyao Lai Siyao added a comment - Andreas, yes, https://review.whamcloud.com/10110 can be abandoned and this can be closed.

            Lai, with the changes in patch https://review.whamcloud.com/45370 "LU-14448 lod: verify LOV early in lod_get_default_striping" and patch https://review.whamcloud.com/45237 "LU-15070 llite: update default LMV upon any change" is there anything left to be done here?

            If not, then the patch https://review.whamcloud.com/10110 "LU-7357 lmv: add layout lock to striped directory" could be abandoned and this ticket closed.

            adilger Andreas Dilger added a comment - Lai, with the changes in patch https://review.whamcloud.com/45370 " LU-14448 lod: verify LOV early in lod_get_default_striping " and patch https://review.whamcloud.com/45237 " LU-15070 llite: update default LMV upon any change " is there anything left to be done here? If not, then the patch https://review.whamcloud.com/10110 " LU-7357 lmv: add layout lock to striped directory " could be abandoned and this ticket closed.
            laisiyao Lai Siyao added a comment -

            Now directory layout is protected by LOOKUP lock, since directory layout is revoked only by directory migration/shrink and LFSCK layout recreate, put it under LOOKUP lock won't cause too many lock revoke.

            laisiyao Lai Siyao added a comment - Now directory layout is protected by LOOKUP lock, since directory layout is revoked only by directory migration/shrink and LFSCK layout recreate, put it under LOOKUP lock won't cause too many lock revoke.
            laisiyao Lai Siyao added a comment -

            Directory migration will migrate directory to a new fid, so the inode is different after migration. But there is one place that directory layout may change: after all sub files migration the parent directory will be shrunk to contain new layout only.

            But I don't see the benefit of introducing this bit, because it can't eleminate race: client can't hold ibit lock, its layout can be stale at any moment with or without this bit lock. But this race is not serious, because https://review.whamcloud.com/#/c/31504/ adds rules to access migrating directory, operations through old layout may fail, but they won't corrupt the directory.

            Directory layout will be updated after each lookup, getattr, setattr, setdirstripe and open, I'd say it's protected by UPDATE bit, but it's used by MDT to serialize operations, client won't clear its directory layout upon UPDATE bit revoke, because it needs layout information to access directory (just like fid), and I think we've kept it up-to-date already.

            laisiyao Lai Siyao added a comment - Directory migration will migrate directory to a new fid, so the inode is different after migration. But there is one place that directory layout may change: after all sub files migration the parent directory will be shrunk to contain new layout only. But I don't see the benefit of introducing this bit, because it can't eleminate race: client can't hold ibit lock, its layout can be stale at any moment with or without this bit lock. But this race is not serious, because https://review.whamcloud.com/#/c/31504/ adds rules to access migrating directory, operations through old layout may fail, but they won't corrupt the directory. Directory layout will be updated after each lookup, getattr, setattr, setdirstripe and open, I'd say it's protected by UPDATE bit, but it's used by MDT to serialize operations, client won't clear its directory layout upon UPDATE bit revoke, because it needs layout information to access directory (just like fid), and I think we've kept it up-to-date already.

            Lai, is there actually a need for a separate layout bit for directory migration? Oleg thinks we can use the UPDATE bit to cancel the directory cache. Will the client get a new directory layout after that?

            adilger Andreas Dilger added a comment - Lai, is there actually a need for a separate layout bit for directory migration? Oleg thinks we can use the UPDATE bit to cancel the directory cache. Will the client get a new directory layout after that?

            This will be needed when we implement directory restriping.

            adilger Andreas Dilger added a comment - This will be needed when we implement directory restriping.
            pjones Peter Jones added a comment -

            Di

            This appears to have been your patch originally

            Peter

            pjones Peter Jones added a comment - Di This appears to have been your patch originally Peter

            All the details are in the patch : http://review.whamcloud.com/#/c/10110. The patch needs a rebase.

            simmonsja James A Simmons added a comment - All the details are in the patch : http://review.whamcloud.com/#/c/10110 . The patch needs a rebase.
            green Oleg Drokin added a comment -

            So I am not really sure what does it have to do with layout lock?

            Unlink invalidates an update lock to flush client readdir cache and that should be enough.

            Can you please elaborate here about what it is you are trying to achieve?

            green Oleg Drokin added a comment - So I am not really sure what does it have to do with layout lock? Unlink invalidates an update lock to flush client readdir cache and that should be enough. Can you please elaborate here about what it is you are trying to achieve?

            People

              laisiyao Lai Siyao
              simmonsja James A Simmons
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: