Whamcloud - gitweb
LU-16500 utils: 'lfs migrate' should select new OSTs 00/54600/4
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 28 Mar 2024 03:18:56 +0000 (21:18 -0600)
committerOleg Drokin <green@whamcloud.com>
Mon, 15 Apr 2024 16:54:12 +0000 (16:54 +0000)
commit2007ab4709acaef0397df15c9f4cf4387844ba9c
treee54957ad6d48b5dc25e908ce5281885e7a0a1e6d
parent27fe42d294021b1eaf12397a8ca44bf20a7198ad
LU-16500 utils: 'lfs migrate' should select new OSTs

When migrating a file using "lfs migrate FILE" without any arguments
to specify a new layout, this should migrate the file to the best
OSTs available at that time based on free space, instead of keeping
the file on the same OSTs (which is almost pointless otherwise).

Reset the starting OST index for all components of the copied file
layout so that this can happen properly.  Previously, only the last
component had the OST index reset, which was only partly helpful.

Add llapi_layout_ost_index_reset() to handle this, since it seems
likely that tools using llapi_layout_from_fd() and friends to copy
an existing layout will want to do the same.  Add the corresponding
man page and reference it from llapi_layout_get_from_fd().

Update sanity test_56xe to check that the starting OST index of each
component is not the same for all components.  This check might not
catch a broken "lfs migrate" every time since even before this patch
the last component would be allocated on a random OST, but will still
fail about once every 1/$OST_COUNT runs.  Conversely, with this patch
it passes hundreds of iterations without a false positive, though a
small chance exists that it will have a false positive on occasion.

Add a "make utils" target to simplify building only user utilities.

Test-Parameters: testlist=sanity env=ONLY=56xe,ONLY_REPEAT=100
Fixes: 0568f4ca25 ("LU-16500 utils: set default ost index for lfs migrate")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie4c68d4b2ff09560a7a13ae464723745cf968d36
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54600
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Stephane Thiell <sthiell@stanford.edu>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
autoMakefile.am
lustre/doc/Makefile.am
lustre/doc/llapi_layout.7
lustre/doc/llapi_layout_get_by_fd.3
lustre/doc/llapi_layout_ost_index_reset.3 [new file with mode: 0644]
lustre/include/lustre/lustreapi.h
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi_layout.c