client_evicted() used to check for client eviction based on result of
lfs df. When it returned any error but EOPNOTSUPP - that was taken as
"client was evicted".
When glibc's realpath() changed to not call stat()
(see for ref
stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ
..
- Realpath mishandles EOVERFLOW; stat not needed anyway (BZ#24970).
)
'lfs df' started to return EOPNOTSUPP from lfs_df(). client_evicted()
was changed, now any non-zero return is taken as client was evicted.
Check for "This client was evicted" in dmesg output to make sure that
eviction happened.
Add a comment in ptlrpc_import_recovery_state_machine() to make it
clear that this specific error message is used by the test code. Avoid
ratelimiting for the message.
Lustre-change: https://review.whamcloud.com/54299
Lustre-commit:
ab5a2b63fb90b75ef07d25b347423e2db05286ef
Fixes:
a5a9ded43b ("LU-16916 tests: fix client_evicted() not to ignore EOPNOTSUPP")
Test-Parameters: trivial testlist=replay-vbr,recovery-small
HPE-bug-id: LUS-11742
Signed-off-by: Vladimir Saveliev <vladimir.saveliev@hpe.com>
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I10ef99d23d630164bfdf167e54e2f177e9b85598
/* Don't care about MGC eviction */
if (strcmp(imp->imp_obd->obd_type->typ_name,
LUSTRE_MGC_NAME) != 0) {
- LCONSOLE_ERROR_MSG(0x167, "%s: This client was evicted "
- "by %.*s; in progress operations "
- "using this service will fail.\n",
- imp->imp_obd->obd_name, target_len,
- target_start);
+ /* below message checked in test-framework client_evicted() */
+ LCONSOLE(D_ERROR, "%s: This client was evicted by %.*s; in progress operations using this service will fail.\n",
+ imp->imp_obd->obd_name, target_len, target_start);
LASSERTF(!obd_lbug_on_eviction, "LBUG upon eviction\n");
}
CDEBUG(D_HA, "evicted from %s@%s; invalidating\n",
$LFS df $DIR
- local testid=$(echo $TESTNAME | tr '_' ' ')
- dmesg | tac | sed "/$testid/,$ d" | grep "This client was evicted" &&
+ client_evicted $CLIENT1 &&
error "client got evicted due to aborted recovery"
return 0
}
lfs_df_check $1
}
+# usage: client_evicted client [evictor, mds1 by default]
+# return true if \a client was evicted by \a evictor in current test
client_evicted() {
- sleep 1
- ! _lfs_df_check $1
+ local testid=$(echo $TESTNAME | tr '_' ' ')
+ local client=$1
+ local facet=${2:-mds1}
+ local dev=$(facet_svc $facet)
+
+ client_up $client
+ $PDSH $client "dmesg | tac | sed \"/$testid/,$ d\"" |
+ grep -q "client was evicted by ${dev}"
}
client_reconnect_try() {