Whamcloud - gitweb
LU-13449 tgt: fix recovery timer comparisons 66/38366/2
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 25 Apr 2020 10:19:42 +0000 (04:19 -0600)
committerOleg Drokin <green@whamcloud.com>
Thu, 7 May 2020 05:46:28 +0000 (05:46 +0000)
commit814bb394843434883a94fe6432cd8c656035a3e1
treeb44f9132360cf610cb135deba5ceebfb616e1b10
parent83906f97c1d3b85904ffa257ee53693528e5fae7
LU-13449 tgt: fix recovery timer comparisons

The obd_recovery_start time was changed to use a monotonic kernel
clock via ktime_get_seconds(), which is a relative kernel time in
newer kernels.  However, it was still being compared with wallclock
time in some places, which lead to incorrect calculations.

Always use the monotonic clock within the kernel, but convert the
times to wallclock time when they are printed to userspace.

Fix the added recovery-small test_140b to use the actual recovery time
rather than the entire failover time, since that may increased too
much by operations unrelated to the MDS recovery.

Fixes: 8bd04b4e5766 ("LU-12722 target: disable recovery for local clients")
Fixes: 06408a4ef381 ("LU-12769 recovery: use monotonic timer")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ibe866463cbad81010e91f630a1088990f8a48664
Reviewed-on: https://review.whamcloud.com/38366
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ldlm/ldlm_lib.c
lustre/obdclass/lprocfs_status_server.c
lustre/tests/recovery-small.sh
lustre/tests/test-framework.sh