Whamcloud - gitweb
LU-15720 dne: add crush2 hash type
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 12 Apr 2022 23:18:10 +0000 (17:18 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Jun 2024 08:16:39 +0000 (08:16 +0000)
commit1232c412d36d408cde33310593fd22cab1fadf23
tree565a7a2dbbd62ba1b16bd29c27381cb3ee002fa6
parentf50f99c4d6078c373532f3ecd5dd2da794739d40
LU-15720 dne: add crush2 hash type

The original "crush" hash type has a significant error with files
that have all-number suffixes, or suffixes that have non-alpha
characters in them.  These files will all be placed on the same
MDT as the base filename, which causes MDT imbalance.

Add a "crush2" hash type that has more stringent checks for the
suffix, so that it doesn't consider all-digit suffixes, or files
that only have a '.' at the right offset, as temporary files.

Test that the "broken" all-digit or extra-'.' filenames are hashed
properly with "crush2".  We also need to confirm that the old "crush"
hash has not changed (for name lookup compatibility) and still has
the original "bad hashing" bug that puts all files on the same MDT.

Fix handling of types beyond MDT_HASH_TYPE_CRUSH when creating dirs.

Fix debug layout printing of hash_type in more parts of the code.
Don't flood console if hash type is unrecognized in the future.

Lustre-change: https://review.whamcloud.com/47015
Lustre-commit: 1ac4b9598ad6e2f94c4c672b4733186364255c6a

Lustre-change: https://review.whamcloud.com/48713
Lustre-commit: e17471792388e59f44040d48dd8138ec865663af

Fixes: 0a1cf8da8069 ("LU-11025 dne: introduce new directory hash type 'crush'")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1ce34b8f3af44432f55307ebc6906677c6179d1d
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54925
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
15 files changed:
lustre/include/lu_object.h
lustre/include/lustre_lmv.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/lmv/lmv_obd.c
lustre/lod/lod_object.c
lustre/lod/lproc_lod.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_reint.c
lustre/mdt/mdt_restripe.c
lustre/tests/sanity.sh
lustre/tests/test-framework.sh
lustre/utils/lfs.c