From: John Spray Date: Tue, 3 Mar 2015 20:14:28 +0000 (+0000) Subject: mds: flush immediately in do_open_truncate X-Git-Tag: v9.0.0~218^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3865%2Fhead;p=ceph.git mds: flush immediately in do_open_truncate Previously truncating opens were horribly laggy for clients when the system was otherwise idle, as they would wait for the next tick() before proceeding. Fixes: #11011 Signed-off-by: John Spray --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index d572340be1e7..846ade3cb0aa 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -3618,6 +3618,10 @@ void Server::do_open_truncate(MDRequestRef& mdr, int cmode) journal_and_reply(mdr, in, dn, le, new C_MDS_inode_update_finish(mds, mdr, in, old_size > 0, changed_ranges)); + // Although the `open` part can give an early reply, the truncation won't + // happen until our EUpdate is persistent, to give the client a prompt + // response we must also flush that event. + mdlog->flush(); }