Skip to content

Commit a86ee49

Browse files
lxbszSunnatillo
authored andcommitted
mds: add 'mds_allow_async_dirops' opt to allow/disable async dirop
The lock cache is buggy and we need to disable it as a workaround. Fixes: https://tracker.ceph.com/issues/65607 Signed-off-by: Xiubo Li <[email protected]>
1 parent 8056c23 commit a86ee49

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

src/common/options/mds.yaml.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,14 @@ options:
990990
- mds
991991
fmt_desc: Ceph will randomly fragment or merge directories.
992992
with_legacy: true
993+
- name: mds_allow_async_dirops
994+
type: bool
995+
level: advanced
996+
default: true
997+
services:
998+
- mds
999+
fmt_desc: MDS will enable/disable the async dirop feature.
1000+
with_legacy: true
9931001
- name: mds_dump_cache_on_map
9941002
type: bool
9951003
level: dev

src/mds/MDSRank.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4116,7 +4116,8 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
41164116
"mds_session_cap_acquisition_throttle", \
41174117
"mds_session_max_caps_throttle_ratio", \
41184118
"mds_session_metadata_threshold", \
4119-
"mds_symlink_recovery"
4119+
"mds_symlink_recovery", \
4120+
"mds_allow_async_dirops"
41204121

41214122
constexpr bool is_sorted = [] () constexpr {
41224123
constexpr auto arr = std::to_array<std::string_view>({KEYS});

src/mds/Server.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,9 @@ void Server::evict_cap_revoke_non_responders() {
13501350
}
13511351

13521352
void Server::handle_conf_change(const std::set<std::string>& changed) {
1353+
if (changed.count("mds_allow_async_dirops")){
1354+
mds_allow_async_dirops = g_conf().get_val<bool>("mds_allow_async_dirops");
1355+
}
13531356
if (changed.count("mds_forward_all_requests_to_auth")){
13541357
forward_all_requests_to_auth = g_conf().get_val<bool>("mds_forward_all_requests_to_auth");
13551358
}
@@ -2522,7 +2525,7 @@ void Server::set_reply_extra_bl(const cref_t<MClientRequest> &req, inodeno_t ino
25222525
{
25232526
Session *session = mds->get_session(req);
25242527

2525-
if (session->info.has_feature(CEPHFS_FEATURE_DELEG_INO)) {
2528+
if (mds_allow_async_dirops && session->info.has_feature(CEPHFS_FEATURE_DELEG_INO)) {
25262529
openc_response_t ocresp;
25272530

25282531
dout(10) << "adding created_ino and delegated_inos" << dendl;
@@ -4815,7 +4818,7 @@ void Server::handle_client_openc(const MDRequestRef& mdr)
48154818
if (!check_dir_max_entries(mdr, dir))
48164819
return;
48174820

4818-
if (mdr->dn[0].size() == 1)
4821+
if (mds_allow_async_dirops && mdr->dn[0].size() == 1)
48194822
mds->locker->create_lock_cache(mdr, diri, &mdr->dir_layout);
48204823

48214824
// create inode.
@@ -8196,7 +8199,7 @@ void Server::handle_client_unlink(const MDRequestRef& mdr)
81968199
return; // we're waiting for a witness.
81978200
}
81988201

8199-
if (!rmdir && dnl->is_primary() && mdr->dn[0].size() == 1)
8202+
if (mds_allow_async_dirops && !rmdir && dnl->is_primary() && mdr->dn[0].size() == 1)
82008203
mds->locker->create_lock_cache(mdr, diri);
82018204

82028205
// ok!

src/mds/Server.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ class Server {
544544
feature_bitset_t supported_metric_spec;
545545
feature_bitset_t required_client_features;
546546

547+
bool mds_allow_async_dirops = true;
547548
bool forward_all_requests_to_auth = false;
548549
bool replay_unsafe_with_closed_session = false;
549550
double cap_revoke_eviction_timeout = 0;

0 commit comments

Comments
 (0)