]> 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)
committerSunnatillo <sunnat.samadov@est.tech>
Tue, 7 Jan 2025 08:44:54 +0000 (10:44 +0200)
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>
src/common/options/mds.yaml.in
src/mds/MDSRank.cc
src/mds/Server.cc
src/mds/Server.h

index 03a53cd7ceaca15d4a959ab64c56cdb14ed66245..f8cb897dacd0dab2d815d161d6b610a36e78174b 100644 (file)
@@ -990,6 +990,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 52ed930d71b1369fdf7ec92b68bb8f06c498711b..9448e63749f14bd2db65627a1d6c4e8f3f636e70 100644 (file)
@@ -4116,7 +4116,8 @@ const char** MDSRankDispatcher::get_tracked_conf_keys() const
     "mds_session_cap_acquisition_throttle", \
     "mds_session_max_caps_throttle_ratio", \
     "mds_session_metadata_threshold", \
-    "mds_symlink_recovery"
+    "mds_symlink_recovery", \
+    "mds_allow_async_dirops"
 
   constexpr bool is_sorted = [] () constexpr {
     constexpr auto arr = std::to_array<std::string_view>({KEYS});
index 5874a3dce568504515fcd13b8f531d53dbda4af1..311bedef793dad401b52a7dd26c8780bbd11c197 100644 (file)
@@ -1350,6 +1350,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");
   }
@@ -2522,7 +2525,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;
@@ -4815,7 +4818,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.
@@ -8196,7 +8199,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 5f9a763e5508a92249198b38b6464ea000c58444..0a6391d5b681129ebc180e8085eb8f7a8e2ea083 100644 (file)
@@ -544,6 +544,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;