]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush immediately in do_open_truncate 3865/head
authorJohn Spray <john.spray@redhat.com>
Tue, 3 Mar 2015 20:14:28 +0000 (20:14 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 3 Mar 2015 20:14:28 +0000 (20:14 +0000)
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 <john.spray@redhat.com>
src/mds/Server.cc

index d572340be1e76c0e9a5866e4befa8576047d9d79..846ade3cb0aaa768e4f571865a61b82467bd6733 100644 (file)
@@ -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();
 }