[LU-5916] OST pool inheritence is no longer persistent (no LOV EA for child directory) Created: 13/Nov/14 Updated: 24/Feb/17 Resolved: 29/Dec/14 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.6.0, Lustre 2.7.0, Lustre 2.5.2, Lustre 2.4.3 |
| Fix Version/s: | Lustre 2.7.0, Lustre 2.5.4 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Thomas LEIBOVICI - CEA (Inactive) | Assignee: | Niu Yawei (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | HB | ||
| Environment: |
el6 |
||
| Issue Links: |
|
||||
| Severity: | 3 | ||||
| Rank (Obsolete): | 16515 | ||||
| Description |
|
A child directory should inherit from the OST pool of its parent. In Lustre 2.4 to master (2.7), this is no longer the case: the child directory has no LOV EA stored on the MDS, so the pool inheritance is lost when the MDS restarts. lfs getstripe indicates the child directory doesn't inherit from its parent pool. mkdir /mnt/lustre/dir Then, after restarting the MDS: |
| Comments |
| Comment by Peter Jones [ 13/Nov/14 ] |
|
Niu Could you please advise? Thanks Peter |
| Comment by Niu Yawei (Inactive) [ 14/Nov/14 ] |
|
I checked the code, looks we lost this when integrating LOD into the stack (that's from 2.3.51), because the default trusted.lov can still being inherited from parent and cached in memory, so creating file before restarting MDS should be fine. See the comment from mdd_object_create(): /* During creation, there are only a few cases we need do xattr_set to * create stripes. * 1. regular file: see comments above. * 2. create striped directory with provided stripeEA. * 3. create striped directory because inherit default layout from the * parent. */ Obviously we missed the 4th case that creating dir which inherits default striping (XATTR_NAME_LOV) from parent. And seems there are some other problems in this code path: In declare stage, see mdd_declare_object_create(): /* replay case, create LOV EA from client data */ if (spec->no_create || (spec->sp_cr_flags & MDS_OPEN_HAS_EA && S_ISREG(attr->la_mode))) { const struct lu_buf *buf; buf = mdd_buf_get_const(env, spec->u.sp_ea.eadata, spec->u.sp_ea.eadatalen); rc = mdo_declare_xattr_set(env, c, buf, XATTR_NAME_LOV, 0, handle); if (rc) GOTO(out, rc); } It just missed declare for the case of inheriting parent's XATTR_NAME_LMV or XATTR_NAME_LOV. In create stage, see mdd_object_create(): if (spec->no_create || (S_ISREG(attr->la_mode) && spec->sp_cr_flags & MDS_OPEN_HAS_EA) || S_ISDIR(attr->la_mode)) { const struct lu_buf *buf; buf = mdd_buf_get_const(env, spec->u.sp_ea.eadata, spec->u.sp_ea.eadatalen); rc = mdo_xattr_set(env, son, buf, S_ISDIR(attr->la_mode) ? XATTR_NAME_LMV : XATTR_NAME_LOV, 0, handle, BYPASS_CAPA); if (rc != 0) GOTO(err_destroy, rc); } It seems to me that when inheriting parent's XATTR_NAME_LMV, the passed spec->u.sp_ea.eadata should be NULL, I'm not sure how it worked. Di, could take a look to see if I missed anytying here? |
| Comment by Gerrit Updater [ 17/Nov/14 ] |
|
Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/12746 |
| Comment by Niu Yawei (Inactive) [ 17/Nov/14 ] |
|
I looked into the code closer and realized that the NAME_LOV for default stripping/pool is declared in lod_declare_object_create() and the NAME_LOV is set in mdd_object_create() -> lod_xattr_set() -> lod_dir_striping_create(), but for the case of parent has only pool setting (no default stripping), inheriting NAME_LOV is skipped mistakenly, see lod_dir_striping_create_internal(): /* Transfer default LOV striping from the parent */ if (lo->ldo_striping_cached && !LOVEA_DELETE_VALUES(lo->ldo_def_stripe_size, lo->ldo_def_stripenr, lo->ldo_def_stripe_offset)){ This patch fix the problem: http://review.whamcloud.com/#/c/12746 |
| Comment by Gerrit Updater [ 17/Nov/14 ] |
|
Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/12746 |
| Comment by Gerrit Updater [ 19/Dec/14 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/12746/ |
| Comment by Jodi Levi (Inactive) [ 29/Dec/14 ] |
|
Patch landed to Master. |
| Comment by Henri Doreau (Inactive) [ 14/Jan/15 ] |
|
Could a backport to b2_5 be considered? The patch fixes a critical regression. |
| Comment by Niu Yawei (Inactive) [ 15/Jan/15 ] |
|
Sure, I'm going to port it to b2_5. |
| Comment by Gerrit Updater [ 15/Jan/15 ] |
|
Niu Yawei (yawei.niu@intel.com) uploaded a new patch: http://review.whamcloud.com/13411 |
| Comment by Niu Yawei (Inactive) [ 15/Jan/15 ] |
|
port to b2_5: http://review.whamcloud.com/#/c/13411/ |
| Comment by Gerrit Updater [ 27/Jan/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13411/ |