[LU-10258] lfs mirror command to read/write specific mirror copy Created: 19/Nov/17  Updated: 13/Jun/22  Resolved: 21/Mar/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.13.0, Lustre 2.12.3

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Zhenyu Xu
Resolution: Fixed Votes: 0
Labels: FLR2

Issue Links:
Related
is related to LU-5170 lfs usability Open
is related to LU-9771 FLR1: Landing tickets for File Level ... Resolved
is related to LU-11245 add 'lfs mirror dump' to dump a mirro... Resolved
is related to LU-10177 DoM: manual migration MDT-OST Resolved
is related to LU-11421 DoM: manual migration OST-MDT, MDT-MDT Resolved
is related to LU-13831 lfs mirror command to open a specific... Open
Rank (Obsolete): 9223372036854775807

 Description   

It would be useful to add an "lfs open [--ifcomp=<component_id>] [--ofcomp=<component_id>] <command>" that opens the stdin and/or stdout with the specified component ID values, so that e.g. "dd" could be used as a resync tool for stale components, or other arbitrary commands (e.g. MPI file utils for parallel resync, HSM tools for archive handling, etc).

Also useful would be to open a specific mirror number for whole-file access, instead of just a single component. That would be something like "--ifrepl=" and "--ofrepl=" options.



 Comments   
Comment by Jinshan Xiong (Inactive) [ 23/Nov/17 ]

Should we support the command like lfs mirror dd [--if=<mirror_id>] [--of=<mirror_id>] instead? If -if is not existing, it will read from stdin; if of is not existing, it will write to stdout. Multiple -off can be supported if necessary. This is more like unix and is able to use pipe to chain commands.

The problem with --ifcomp is that sometimes components are not started from beginning of the file; neither are components perfectly aligned. Therefore it would be hard to define the semantics clearly.

Comment by Jinshan Xiong (Inactive) [ 23/Nov/17 ]

From https://review.whamcloud.com/#/c/29100/23/lustre/doc/lfs-mirror-verify.1

Andreas Dilger Nov 22 9:37 PM

Not for this patch, but it would be interesting to use something like:
lfs open --ifrepl=N <file> | diff <file> /dev/stdin
(or with cmp) to be able to find what is different between two replicas.
That makes me wonder if we would want some special open syntax some time later, like:
diff <file> "<file>;N"
to allow opening replica N directly from the command line? This uses the same naming to be consistent with VAX VMS file versions, and has the benefit that virtually no files will have ';' in the name because this is a shell metacharacter. The drawback is that accessing non-primary components would always need to escape or quote the file name, which is probably OK if it isn't commonly used. We might use something like ",,N" to allow easier usage, but have a higher risk of collisions with existing filenames.

Comment by Andreas Dilger [ 25/Nov/17 ]

The problem with --ifcomp is that sometimes components are not started from beginning of the file; neither are components perfectly aligned. Therefore it would be hard to define the semantics clearly.

I think there are legitimate use cases for opening a component and allowing writes outside of the component start/end. For example, migrating a large DoM file from the MDT to the start of an OST object and freeing up space on the MDT.

Comment by Andreas Dilger [ 20/Sep/18 ]

I wonder if we should rename this to "lfs mirror write" and rename "lfs mirror dump" to "lfs mirror read" for consistency?

Comment by Gerrit Updater [ 22/Sep/18 ]

Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/33219
Subject: LU-10258 lfs: lfs mirror write command
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 08c8accd22dc1021da3a0c37d8c6a33f1bf44607

Comment by Gerrit Updater [ 22/Sep/18 ]

Bobi Jam (bobijam@hotmail.com) uploaded a new patch: https://review.whamcloud.com/33220
Subject: LU-10258 lfs: lfs mirror copy command
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 075a96702fe89c37a9a4e1c11401a75d173dfdad

Comment by Gerrit Updater [ 02/Nov/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33219/
Subject: LU-10258 lfs: lfs mirror write command
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 14171e787dd00902af7c9edf10a6b54aab45f7b2

Comment by Gerrit Updater [ 21/Mar/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33220/
Subject: LU-10258 lfs: lfs mirror copy command
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: c6e7c0788d7cd766880d12eae6679782283dc479

Comment by Peter Jones [ 21/Mar/19 ]

Landed for 2.13

Comment by Gerrit Updater [ 16/Sep/19 ]

Jian Yu (yujian@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36193
Subject: LU-10258 lfs: lfs mirror copy command
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 00a5d4a04710b5c939b81c422e7b800471ffd83d

Comment by Gerrit Updater [ 23/Sep/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36193/
Subject: LU-10258 lfs: lfs mirror copy command
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 24f181513fb14f111455ec113d69a6ce5b50cf56

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