Removed `O_SYNC` from StatusUpdateManager. The StatusUpdateManager data is not recovered after reboot. This means we can rely on flushes to the page cache to be sufficient for writing status updates.
Review: https://reviews.apache.org/r/50635/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d566536f Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d566536f Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d566536f Branch: refs/heads/master Commit: d566536f645ec73c41caa4ac90b232205a330a56 Parents: f291d50 Author: Joris Van Remoortere <joris.van.remoort...@gmail.com> Authored: Tue Aug 2 11:33:08 2016 -0700 Committer: Joris Van Remoortere <joris.van.remoort...@gmail.com> Committed: Tue Aug 2 11:33:08 2016 -0700 ---------------------------------------------------------------------- src/slave/status_update_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/d566536f/src/slave/status_update_manager.cpp ---------------------------------------------------------------------- diff --git a/src/slave/status_update_manager.cpp b/src/slave/status_update_manager.cpp index 9d16e0d..9c67b85 100644 --- a/src/slave/status_update_manager.cpp +++ b/src/slave/status_update_manager.cpp @@ -676,9 +676,13 @@ StatusUpdateStream::StatusUpdateStream( } // Open the updates file. + // NOTE: We don't use `O_SYNC` here because we only read this file + // if the host did not crash. `os::write` success implies the kernel + // will have flushed our data to the page cache. This is sufficient + // for the recovery scenarios we use this data for. Try<int> result = os::open( path.get(), - O_CREAT | O_WRONLY | O_APPEND | O_SYNC | O_CLOEXEC, + O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (result.isError()) {