[LU-7357] Add layout lock for striped directories. Created: 29/Oct/15  Updated: 30/Nov/21  Resolved: 30/Nov/21

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: James A Simmons Assignee: Lai Siyao
Resolution: Won't Do Votes: 0
Labels: dne2, dne3

Issue Links:
Blocker
is blocking LU-4684 DNE3: allow migrating DNE striped dir... Resolved
Duplicate
Related
is related to LU-6831 The ticket for tracking all DNE2 bugs Reopened
is related to LU-14448 lod_get_default_lov_striping() may cr... Resolved
is related to LU-15070 client does not inherit default direc... Resolved
is related to LU-8230 Remove "Provides: lustre-client" Closed
Rank (Obsolete): 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.



 Comments   
Comment by Oleg Drokin [ 30/Oct/15 ]

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?

Comment by James A Simmons [ 30/Oct/15 ]

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

Comment by Peter Jones [ 31/Oct/15 ]

Di

This appears to have been your patch originally

Peter

Comment by Andreas Dilger [ 09/Sep/16 ]

This will be needed when we implement directory restriping.

Comment by Andreas Dilger [ 18/Dec/17 ]

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?

Comment by Lai Siyao [ 28/Apr/18 ]

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.

Comment by Lai Siyao [ 06/Dec/18 ]

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.

Comment by Andreas Dilger [ 29/Nov/21 ]

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.

Comment by Lai Siyao [ 30/Nov/21 ]

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

Generated at Sat Feb 10 02:08:11 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.