Adding an abstraction for log flush.
Merge branch 'master' into replication