Skip to content

Commit 5d6dd5d

Browse files
committed
mds: trigger to flush the mdlog in handle_find_ino()
If the the CInode was just created by using openc in current auth MDS, but the client just sends a getattr request to another replica MDS. Then here it will make a path of '#INODE-NUMBER' only because the CInode hasn't been linked yet, and the replica MDS will keep retrying until the auth MDS flushes the mdlog and the C_MDS_openc_finish and link_primary_inode are called at most 5 seconds later. Fixes: https://tracker.ceph.com/issues/55240 Signed-off-by: Xiubo Li <[email protected]>
1 parent f6d1cb6 commit 5d6dd5d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/mds/MDCache.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9484,6 +9484,19 @@ void MDCache::handle_find_ino(const cref_t<MMDSFindIno> &m)
94849484
if (in) {
94859485
in->make_path(r->path);
94869486
dout(10) << " have " << r->path << " " << *in << dendl;
9487+
9488+
/*
9489+
* If the the CInode was just created by using openc in current
9490+
* auth MDS, but the client just sends a getattr request to another
9491+
* replica MDS. Then here it will make a path of '#INODE-NUMBER'
9492+
* only because the CInode hasn't been linked yet, and the replica
9493+
* MDS will keep retrying until the auth MDS flushes the mdlog and
9494+
* the C_MDS_openc_finish and link_primary_inode are called at most
9495+
* 5 seconds later.
9496+
*/
9497+
if (!in->get_parent_dn() && in->is_auth()) {
9498+
mds->mdlog->flush();
9499+
}
94879500
}
94889501
mds->send_message_mds(r, mds_rank_t(m->get_source().num()));
94899502
}

0 commit comments

Comments
 (0)