[LU-12867] DNE3: new DNE2 hash function to handle rsync temporary filename Created: 16/Oct/19  Updated: 31/Mar/22  Resolved: 03/Apr/20

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

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Lai Siyao
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-13481 sanity test_33h: MDT index mismatch 5... Resolved
is related to LU-11025 DNE3: directory restripe Resolved
Rank (Obsolete): 9223372036854775807

 Description   

When copying or resyncing a file with rsync it will create a temporary pathname for the target file, copy the data into the temporary pathname, and then rename the file over the original in order to avoid damaging the original file if the rsync is interrupted.

$ rsync twoshoes.dilger.ca:/myth/tv/2103_20150920012700.mpg .
^Z
ls -l .2*
 3328 -rw-------  1 adilger 2883584 Oct 16 09:10 .2103_20150920012700.mpg.gyCFCs

It is creating a temporary file with a leading "." and a trailing ".XXXXXX" using mktemp(3) or similar. When the temporary filename is renamed to the target filename in a striped directory, it would likely move to a new MDT and become a remote entry. That causes overhead due to invoking remote rename operations, and leaves a lasting performance impact due to the remote directory entry.

It would be useful to add a new hash function (e.g. FNV_1a_TEMP) that will handle the case of filenames with a leading "." and trailing ".xxxxxx" 6-8 chars after the "." by dropping those parts of the filename and using the remaining characters for the hash, on the assumption that the final filename would be the just the remaining characters. That will keep the rename to be local to a single MDT in most cases, and not be worse than the current case.



 Comments   
Comment by Andreas Dilger [ 16/Oct/19 ]

I believe that MPIFileUtils dcp is also creating temporary filenames for the target, so it would be good to handle this case as well, possibly modifying the MPIFileUtils code to make this filename pattern more easily detected.

Comment by Gerrit Updater [ 19/Nov/19 ]

Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36799
Subject: LU-12867 dne: place temp file on MDT where target is
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 92d3050f760f00f22e85abdc456fe8ccb2d6e7f4

Comment by Andreas Dilger [ 03/Apr/20 ]

This functionality was included into the patch https://review.whamcloud.com/36775 "LU-11025 dne: introduce new directory hash type: 'crush'" which landed for 2.14.

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