[LU-10482] enhance "lfs find" to add mirror related search options Created: 10/Jan/18  Updated: 14/Feb/18  Resolved: 14/Feb/18

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

Type: Improvement Priority: Minor
Reporter: Jian Yu Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: FLR2

Issue Links:
Related
is related to LU-5170 lfs usability Open
Rank (Obsolete): 9223372036854775807

 Description   

Enhance "lfs find" to add the following mirror related search options:

[!] --mirror-count|-N [+-]<mirror_cnt>

Number of mirrors.

[!] --file-state <file_state>

State of a mirrored file.
A mirrored file can be one of the following states:

RDONLY - the mirrored file is in read only state, all of the mirrors contain the up-to-date data;
WRITE_PENDING - the mirrored file is being written;
SYNC_PENDING - the mirrored file is being resynchronized.

The user-friendly file state names would be "ro", "write" and "sync".



 Comments   
Comment by Andreas Dilger [ 23/Jan/18 ]

For the "states", are these encoded as component flags? In that case, the handling should just be implemented via lfs find --comp-flags=rdonly or similar.

Comment by Jinshan Xiong (Inactive) [ 23/Jan/18 ]

It's about file state, instead of state for individual components.

Comment by Andreas Dilger [ 24/Jan/18 ]

Where is this state stored? If in LMA, then we might also use this to prevent access from 2.10 clients? If STALE is in incompat LMA flags, then this prevents 2.10 MDS from accessing a mirrored file to prevent it from allowing a 2.10 client to modify it.

Comment by Jinshan Xiong (Inactive) [ 24/Jan/18 ]

It's stored in the layout, the lowest 2 bits of lov_comp_md_v1::lcm_flags. There is a field in the layout to record the current number of mirrors, and I used that to decide if this is a mirrored file, and then prevent 2.10 clients from accessing it.

/**                                                                             
 * on-disk data for lcm_flags. Valid if lcm_magic is LOV_MAGIC_COMP_V1.         
 */                                                                             
enum lov_comp_md_flags {                                                        
        /* the least 2 bits are used by FLR to record file state */             
        LCM_FL_NOT_FLR          = 0,                                            
        LCM_FL_RDONLY           = 1,                                            
        LCM_FL_WRITE_PENDING    = 2,                                            
        LCM_FL_SYNC_PENDING     = 3,                                            
        LCM_FL_FLR_MASK         = 0x3,                                          
};
Comment by Gerrit Updater [ 28/Jan/18 ]

Jian Yu (jian.yu@intel.com) uploaded a new patch: https://review.whamcloud.com/31069
Subject: LU-10482 flr: enhance "lfs find" to add mirror options
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fe971eaec046fe873cb30ee593202970e7869d7d

Comment by Gerrit Updater [ 14/Feb/18 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/31069/
Subject: LU-10482 flr: enhance "lfs find" to add mirror options
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 8cb239805699e925dae594bc82379f0caa43b491

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