From: Christopher Hoffman Date: Thu, 14 Sep 2023 15:11:26 +0000 (+0000) Subject: mds: Add fragment to scrub X-Git-Tag: v18.2.5~599^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ccb968430fbe49a19186010058b0f08997f88e6b;p=ceph.git mds: Add fragment to scrub Add dirfrag split and merge to scrub process. Fixes: https://tracker.ceph.com/issues/57481 Signed-off-by: Christopher Hoffman (cherry picked from commit eadab41eab7220bd749a8217944157050c9513b4) --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 5480e6dcd5ef..bd69646df4fe 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -12514,6 +12514,9 @@ void MDCache::force_readonly() mds->mdlog->flush(); } +void MDCache::maybe_fragment(CDir *dir) { + mds->balancer->maybe_fragment(dir, false); +} // ============================================================== // debug crap diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index f1b58c28d111..cc4604b9bcdd 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -269,6 +269,8 @@ class MDCache { bool is_readonly() { return readonly; } void force_readonly(); + void maybe_fragment(CDir* dir); + static file_layout_t gen_default_file_layout(const MDSMap &mdsmap); static file_layout_t gen_default_log_layout(const MDSMap &mdsmap); diff --git a/src/mds/ScrubStack.cc b/src/mds/ScrubStack.cc index 742c464f4d37..839bb09909fe 100644 --- a/src/mds/ScrubStack.cc +++ b/src/mds/ScrubStack.cc @@ -470,6 +470,7 @@ void ScrubStack::scrub_dirfrag(CDir *dir, bool *done) << " log and `damage ls` output for details"; } + mdcache->maybe_fragment(dir); dir->scrub_finished(); dir->auth_unpin(this);