]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: add 'mds_allow_async_dirops' opt to allow/disable async dirop
authorXiubo Li <xiubli@redhat.com>
Mon, 8 Jul 2024 07:42:14 +0000 (15:42 +0800)
committerVenky Shankar <vshankar@redhat.com>
Mon, 17 Feb 2025 07:05:32 +0000 (12:35 +0530)
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 <xiubli@redhat.com>
(cherry picked from commit a86ee496be932290650a069ee5750557df5054a6)

Conflicts:
    src/mds/MDSRank.cc

Lack of 5c3dddf5e71b2c1ac7d9184722f72620a610fd29 ("mds: add compile time checks for sortedness")

src/common/options/mds.yaml.in
src/mds/MDSRank.cc
src/mds/Server.cc
src/mds/Server.h

index a8f06ecc3ca052a90f067dbfff479e0a6489b6e2..aa9365a843e32ff0f5c647a8a936e0467e5da680 100644 (file)
@@ -892,6 +892,14 @@ options:
   - mds
   fmt_desc: Ceph will randomly fragment or merge directories.
   with_legacy: true
+- name: mds_allow_async_dirops
+  type: bool
+  level: advanced
+  default: true
+  services:
+  - mds
+  fmt_desc: MDS will enable/disable the async dirop feature.
+  with_legacy: true
 - name: mds_dump_cache_on_map
   type: bool
   level: dev
index 9ca24346e58bca032cb9177724534440611bfb07..04df37dded9e724213df86953094602f23a14136 100644 (file)
@@ -3885,6 +3885,7 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
     "mds_inject_rename_corrupt_dentry_first",
     "mds_inject_journal_corrupt_dentry_first",
     "mds_session_metadata_threshold",
+    "mds_allow_async_dirops",
     NULL
   };
   return KEYS;
index 563f339dafce07b0449c5acdfed7f65c134273c1..e641dd508b5da5e73fe931af775f62b5dde51294 100644 (file)
@@ -1319,6 +1319,9 @@ void Server::evict_cap_revoke_non_responders() {
 }
 
 void Server::handle_conf_change(const std::set<std::string>& changed) {
+  if (changed.count("mds_allow_async_dirops")){
+    mds_allow_async_dirops = g_conf().get_val<bool>("mds_allow_async_dirops");
+  }
   if (changed.count("mds_forward_all_requests_to_auth")){
     forward_all_requests_to_auth = g_conf().get_val<bool>("mds_forward_all_requests_to_auth");
   }
@@ -2479,7 +2482,7 @@ void Server::set_reply_extra_bl(const cref_t<MClientRequest> &req, inodeno_t ino
 {
   Session *session = mds->get_session(req);
 
-  if (session->info.has_feature(CEPHFS_FEATURE_DELEG_INO)) {
+  if (mds_allow_async_dirops && session->info.has_feature(CEPHFS_FEATURE_DELEG_INO)) {
     openc_response_t ocresp;
 
     dout(10) << "adding created_ino and delegated_inos" << dendl;
@@ -4755,7 +4758,7 @@ void Server::handle_client_openc(MDRequestRef& mdr)
   if (!check_dir_max_entries(mdr, dir))
     return;
 
-  if (mdr->dn[0].size() == 1)
+  if (mds_allow_async_dirops && mdr->dn[0].size() == 1)
     mds->locker->create_lock_cache(mdr, diri, &mdr->dir_layout);
 
   // create inode.
@@ -8101,7 +8104,7 @@ void Server::handle_client_unlink(MDRequestRef& mdr)
       return;  // we're waiting for a witness.
   }
 
-  if (!rmdir && dnl->is_primary() && mdr->dn[0].size() == 1)
+  if (mds_allow_async_dirops && !rmdir && dnl->is_primary() && mdr->dn[0].size() == 1)
     mds->locker->create_lock_cache(mdr, diri);
 
   // ok!
index df276c66f0b108ee49733cee5d6ee8697695c307..c96caa77de8c81dd9910848e2a5f3531c5487975 100644 (file)
@@ -540,6 +540,7 @@ private:
   feature_bitset_t supported_metric_spec;
   feature_bitset_t required_client_features;
 
+  bool mds_allow_async_dirops = true;
   bool forward_all_requests_to_auth = false;
   bool replay_unsafe_with_closed_session = false;
   double cap_revoke_eviction_timeout = 0;