From: Jeff Layton Date: Mon, 16 Apr 2018 17:48:10 +0000 (-0400) Subject: client: flush the mdlog in _fsync before waiting on unstable reqs X-Git-Tag: v13.1.0~185^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21498%2Fhead;p=ceph.git client: flush the mdlog in _fsync before waiting on unstable reqs Recently, we changed ganesha to call to ceph_ll_sync_inode after issuing a setattr call, to ensure that the attribute changes makes it to the backing store before returning. While testing with this, I noticed that we'd occasionally see setattr calls stall for a long time. Analysis showed that the client's _fsync request was stalled waiting on an mdlog flush. This patch adds a call to flush_mdlog_sync prior to waiting on unsafe requests in _fsync and seems to resolve the issue. Tracker: http://tracker.ceph.com/issues/23714 Signed-off-by: Jeff Layton --- diff --git a/src/client/Client.cc b/src/client/Client.cc index c529535b1150..9f82607609b9 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -9397,6 +9397,8 @@ int Client::_fsync(Inode *in, bool syncdataonly) } else ldout(cct, 10) << "no metadata needs to commit" << dendl; if (!syncdataonly && !in->unsafe_ops.empty()) { + flush_mdlog_sync(); + MetaRequest *req = in->unsafe_ops.back(); ldout(cct, 15) << "waiting on unsafe requests, last tid " << req->get_tid() << dendl;