[LU-11710] File is lost after migrate a sub dir under dir with default stripe Created: 28/Nov/18  Updated: 21/Jan/22  Resolved: 21/Jan/22

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

Type: Bug Priority: Minor
Reporter: Sarah Liu Assignee: WC Triage
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

lustre-b2_10 2.10.6-RC2 (build #149) ldiskfs DNE


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The file is lost after migrate a sub dir under a dir with default stripe, here are the steps
2 MDS with 1 MDT on each, 1 OST, 1 client

[root@trevis-60vm4 ~]# cd /mnt/lustre/
[root@trevis-60vm4 lustre]# mkdir test-0
[root@trevis-60vm4 lustre]# lctl dl
  0 UP mgc MGC10.9.6.158@tcp 3637a725-753d-86b4-1ebf-fb1bdf78fb28 4
  1 UP lov lustre-clilov-ffff978f79f97000 a48ec6c3-f700-afb4-00c3-9288ece40f26 3
  2 UP lmv lustre-clilmv-ffff978f79f97000 a48ec6c3-f700-afb4-00c3-9288ece40f26 3
  3 UP mdc lustre-MDT0000-mdc-ffff978f79f97000 a48ec6c3-f700-afb4-00c3-9288ece40f26 4
  4 UP mdc lustre-MDT0001-mdc-ffff978f79f97000 a48ec6c3-f700-afb4-00c3-9288ece40f26 4
  5 UP osc lustre-OST0000-osc-ffff978f79f97000 a48ec6c3-f700-afb4-00c3-9288ece40f26 4
[root@trevis-60vm4 lustre]# mkdir test-0/test-1
[root@trevis-60vm4 lustre]# lfs setdirstripe -D -c 2 test-0/
[root@trevis-60vm4 lustre]# touch test-0/test-1/foo
[root@trevis-60vm4 lustre]# echo aaa > test-0/test-1/foo 
[root@trevis-60vm4 lustre]# cat test-0/test-1/foo 
aaa
[root@trevis-60vm4 lustre]# lfs migrate -m 1 test-0/test-1
[root@trevis-60vm4 lustre]# ls test-0/test-1/
[root@trevis-60vm4 lustre]# 

I also tried on master branch, it doesn't have the problem



 Comments   
Comment by Andreas Dilger [ 30/Nov/18 ]

Sarah, does this problem still happen if the "lfs setdirstripe" is not run on test-0/? We don't support restriping directories in 2.10, that was added by Lai in 2.12 only. The "lfs migrate" command shouldn't be using the default striping from the parent directory, since the test-1/ directory already exists. If lfs migrate is somehow using the default layout from the parent, then this is a bug and we should not allow migrating to a striped directory.

Comment by Sarah Liu [ 05/Dec/18 ]

Without the "lfs setdirstripe", the problem should gone, I tested dir(without striped) migration long time ago and it worked fine.

Comment by Andreas Dilger [ 05/Dec/18 ]

What this means is that we need to prevent "lfs migrate" from running on a striped directory in 2.10.

Comment by Andreas Dilger [ 21/Jan/22 ]

It looks like this is no longer a problem with 2.12.

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