]> 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:29:33 +0000 (12:59 +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 5c3dddf ("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 dfd0696392fc0b7ceb5efe939779a3ddf3f9f430..05fa4fca9a695f2d2231c2f3319b0414fadf7950 100644 (file)
@@ -963,6 +963,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 0bbd9a07548a16b537219ceffe5ab33be00dc6b9..2330a269961b11393854434167a852c38c89e591 100644 (file)
@@ -4125,6 +4125,7 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
     "mds_session_metadata_threshold",
     "mds_log_trim_threshold",
     "mds_log_trim_decay_rate",
+    "mds_allow_async_dirops",
     NULL
   };
   return KEYS;
index b54d755f453ddb8d3f4e65dabbf5633bc3daf94d..c76c090540e3c36df0e8caf7892496974698179a 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");
   }
@@ -2481,7 +2484,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;
@@ -4766,7 +4769,7 @@ void Server::handle_client_openc(const 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.
@@ -8148,7 +8151,7 @@ void Server::handle_client_unlink(const 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 c410281f5119f67b3c3e7eb69e834bce6a7f456e..a95ce9db33803ef8da2fde77ba49e3ff617c51f9 100644 (file)
@@ -543,6 +543,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;