From: Kotresh HR Date: Sun, 28 Jan 2024 11:30:56 +0000 (+0530) Subject: mds: Add debug messages in replica handling X-Git-Tag: v19.3.0~53^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d79f30099c8471d2543b6ea09e744a6c3fcc1701;p=ceph.git mds: Add debug messages in replica handling Fixes: https://tracker.ceph.com/issues/64241 Signed-off-by: Kotresh HR --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 325da1ae4c9..f79e806494b 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -11139,12 +11139,16 @@ void MDCache::send_dentry_link(CDentry *dn, const MDRequestRef& mdr) CDir *subtree = get_subtree_root(dn->get_dir()); for (const auto &p : dn->get_replicas()) { // don't tell (rename) witnesses; they already know - if (mdr.get() && mdr->more()->witnessed.count(p.first)) + if (mdr.get() && mdr->more()->witnessed.count(p.first)) { + dout(20) << __func__ << " witnesses already know, skip notifying replica for the dentry " << *dn << dendl; continue; + } if (mds->mdsmap->get_state(p.first) < MDSMap::STATE_REJOIN || (mds->mdsmap->get_state(p.first) == MDSMap::STATE_REJOIN && - rejoin_gather.count(p.first))) + rejoin_gather.count(p.first))) { + dout(20) << __func__ << " mds is not ready, skip notifying replica for the dentry " << *dn << dendl; continue; + } CDentry::linkage_t *dnl = dn->get_linkage(); auto m = make_message(subtree->dirfrag(), dn->get_dir()->dirfrag(), dn->get_name(), dnl->is_primary()); if (dnl->is_primary()) { @@ -11218,13 +11222,17 @@ void MDCache::send_dentry_unlink(CDentry *dn, CDentry *straydn, const MDRequestR it != replicas.end(); ++it) { // don't tell (rmdir) witnesses; they already know - if (mdr.get() && mdr->more()->witnessed.count(*it)) + if (mdr.get() && mdr->more()->witnessed.count(*it)) { + dout(20) << __func__ << " witnesses already know, skip notifying replica for the dentry " << *dn << dendl; continue; + } if (mds->mdsmap->get_state(*it) < MDSMap::STATE_REJOIN || (mds->mdsmap->get_state(*it) == MDSMap::STATE_REJOIN && - rejoin_gather.count(*it))) + rejoin_gather.count(*it))) { + dout(20) << __func__ << " mds is not ready, skip notifying replica for the dentry " << *dn << dendl; continue; + } auto unlink = make_message(dn->get_dir()->dirfrag(), dn->get_name()); if (straydn) {