Added by dongdong tao almost 2 years ago. Updated over 1 year ago.
-> second reply is the safe reply for the client, this is the time when the journal has been flushed, and my issue is that client::unmount wait for this reply for almost 5 seconds.
so, through some debugging, i have found that mds would call mdlog->flush() to flush the journal.
so my question is, how can we solve the issue completely by modify the source code ? would that be safe if we add mdlog->flush() at the end of handle_client_reply handle_client_mkdir and so on. could you please give the suggestion here first, i believe this is a bug.
This is the same behaviour you would see if you were running "sync" on a filesystem.
fix the fsync codepath, but we may need something similar for syncfs.
So I guess we should fix this.
i thought "flush_caps_sync" would only flush the caps, why it would also flush the journal?
would this be a final solution for this issue ?
the last cap message has CHECK_CAPS_SYNCHRONOUS flag. mds flushes mdlog when it sees the flag. The patch isn't perfect. It does not work for 'no dirty caps' case.
dongdong tao -- could you please open a pull request with your code change once it is working for you?
ok, John, i will pull a request ASAP.
John, is there any thing else i need to do here for this PR?