private void fsync(final MappedByteBuffer buffer) {
        if (buffer != null) {
            long startMs = Utils.monotonicMs();
            buffer.force();
            final long cost = Utils.monotonicMs() - startMs;
            if (cost >= FSYNC_COST_MS_THRESHOLD) {
                LOG.warn("Call fsync on file {}  cost {} ms.", this.path, cost);
            }
        }
    }
Forces any changes made to this segment file's content to be written to the
storage device containing the mapped file.
jraft-core/src/main/java/com/alipay/sofa/jraft/storage/log/SegmentFile.java