Whamcloud - gitweb
LU-15720 dne: add crush2 hash type 15/47015/8
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 12 Apr 2022 23:18:10 +0000 (17:18 -0600)
committerOleg Drokin <green@whamcloud.com>
Mon, 11 Jul 2022 06:48:37 +0000 (06:48 +0000)
commit1ac4b9598ad6e2f94c4c672b4733186364255c6a
tree7dfd73b9524f582d5e4492e85cd440c16391ee35
parent2e061e88a44db70e4446be567243a38a76ed5370
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.

Fixes: 0a1cf8da8069 ("LU-11025 dne: introduce new directory hash type 'crush'")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1ce34b8f3af44432f55307ebc6906677c6179d1d
Reviewed-on: https://review.whamcloud.com/47015
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Shuichi Ihara <sihara@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lustre/include/lu_object.h
lustre/include/lustre_lmv.h
lustre/include/obd_support.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