[SERVER-18649] Enable sync_file_range and possibly fallocate for WiredTiger Created: 26/May/15  Updated: 05/Feb/16  Resolved: 06/Jul/15

Status: Closed
Project: Core Server
Component/s: WiredTiger
Affects Version/s: None
Fix Version/s: 3.1.6

Type: Improvement Priority: Major - P3
Reporter: Michael Cahill (Inactive) Assignee: David Hows
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

The simplest first step would be to verify that if you manually toggle HAVE_FALLOCATE and HAVE_SYNC_FILE_RANGE in the appropriate pre-generated config.h headers in src/third_party/wiredtiger/build_*, that a patch build works.



 Comments   
Comment by Githook User [ 05/Jul/15 ]

Author:

{u'username': u'daveh86', u'name': u'David Hows', u'email': u'howsdav@gmail.com'}

Message: SERVER-18649 sync_file_range and fallocate for WT
Branch: master
https://github.com/mongodb/mongo/commit/7eee5d26b061ec465af0328f18425d568e252fa2

Comment by Ernie Hershey [ 01/Jun/15 ]

As long as the check is in the main SConstruct, the per-platform builds will run it and set the macro or not as part of the normal build process so we shouldn't have to do anything special.

Comment by Michael Cahill (Inactive) [ 28/May/15 ]

WiredTiger will deal with it just fine if HAVE_FALLOCATE is defined in some builds but not others.

If we can use fallocate when it is available (as opposed to the lowest common denominator approach we're currently taking), that will make WiredTiger more efficient. In particular, by pre-allocating space for log files, flushing the log should only be a single I/O rather than flushing the log data and also the log file metadata (because the file was extended).

daveh86, can you please add HAVE_SYNC_FILE_RANGE directly to all Linux builds (since it's available everywhere), and work up a change to have scons check for the existence of fallocate?

Comment by Ernie Hershey [ 27/May/15 ]

It sounds like a somewhat typical configure-time check that we have many of in scons. Are there complications if it's only on in some platforms vs. being off as it is now?

Comment by David Hows [ 27/May/15 ]

Two options here,

  1. We can modify the config.h has suggested
  2. We can modify the SConscript to detect if sync_file_range and fallocate are available and thus set the particular options (the check would besimilar to how wiredtigers autoconf check works)

Just checked and fallocate is unavailable on RHEL5.5

Generated at Thu Feb 08 03:48:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.