From 12f1b309476f6fe45f06c94867196d0f8839c491 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 21 Apr 2015 20:20:55 +0800 Subject: [PATCH] client: add failure injection for not advancing oldest_tid Signed-off-by: Yan, Zheng --- src/client/Client.cc | 13 +++++++++---- src/common/config_opts.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 2eb4a4801f03b..f77255578a6c9 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1471,10 +1471,15 @@ int Client::make_request(MetaRequest *request, request->set_caller_uid(uid); request->set_caller_gid(gid); - if (!mds_requests.empty()) - request->set_oldest_client_tid(mds_requests.begin()->first); - else - request->set_oldest_client_tid(tid); // this one is the oldest. + if (cct->_conf->client_inject_fixed_oldest_tid) { + ldout(cct, 20) << __func__ << " injecting fixed oldest_client_tid(1)" << dendl; + request->set_oldest_client_tid(1); + } else { + if (!mds_requests.empty()) + request->set_oldest_client_tid(mds_requests.begin()->first); + else + request->set_oldest_client_tid(tid); // this one is the oldest. + } // hack target mds? if (use_mds >= 0) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 60afe9a98dc49..0e623a61b3afa 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -320,6 +320,7 @@ OPTION(client_debug_force_sync_read, OPT_BOOL, false) // always read synchro OPTION(client_debug_inject_tick_delay, OPT_INT, 0) // delay the client tick for a number of seconds OPTION(client_max_inline_size, OPT_U64, 4096) OPTION(client_inject_release_failure, OPT_BOOL, false) // synthetic client bug for testing +OPTION(client_inject_fixed_oldest_tid, OPT_BOOL, false) // synthetic client bug for testing // note: the max amount of "in flight" dirty data is roughly (max - target) OPTION(fuse_use_invalidate_cb, OPT_BOOL, false) // use fuse 2.8+ invalidate callback to keep page cache consistent OPTION(fuse_allow_other, OPT_BOOL, true) -- 2.39.5