Whamcloud - gitweb
LU-16974 utils: fix 'lfs mirror resync --stats' printing 63/59263/7
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 17 May 2025 09:43:57 +0000 (03:43 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 3 Jul 2025 13:21:20 +0000 (13:21 +0000)
commit60784ed61524d8b273e7915ce470520ca588a9fb
treec3fa775f62d8cf1e87f26e1cf090251cc180b7a4
parent182f1744f111734269508ad127134d80f1c7c9e5
LU-16974 utils: fix 'lfs mirror resync --stats' printing

If "lfs mirror resync --stats" is run without --bandwidth-limit,
then no stats are printed until the file resync is 100% finished.

Fix llapi_mirror_resync_many_params() to print the stats even if
no bandwidth throttle is being applied.

Fix write estimate calculation for a file with multiple components.
Print stats with requested granularity, not rounded to next second.

Update the code in lfs.c::migrate_copy_data() to use shared stats
printing and bandwidth throttling with llapi_mirror_resync_many().

Replace direct calls to fprintf() with llapi_err*().
Fix header ordering, remove duplicate headers found.

Test-Parameters: trivial testlist=sanity-flr
Fixes: be131d125a ("LU-16974 utils: lfs mirror resync to show progress")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I68df25501f3cac2647318cff2eb86062f9300c1e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59263
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Alexandre Ioffe <aioffe@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre/lustreapi.h
lustre/utils/lfs.c
lustre/utils/liblustreapi_fid.c
lustre/utils/liblustreapi_hsm.c
lustre/utils/liblustreapi_layout.c
lustre/utils/liblustreapi_util.c
lustre/utils/lustreapi_internal.h