Today, when you call FSDirectory.renameFile it also calls fsync on
This is OK for Lucene's current usage of this method, to rename just
the one segments_N file on commit.
But in playing with adding NRT replication (
LUCENE-5438) to the simple
demo Lucene server (
LUCENE-5376) I found that, on spinning disks, that
fsync is very costly, because when copying over an NRT point, we write
to N .tmp files and then rename many files (taking seconds) in the
I think we should just deprecate/remove the existing method, and make a new
rename method that does only renaming, and a separate
syncMetaData to call fsync on the directory?