Opened 14 years ago

Closed 13 years ago

Last modified 8 years ago

#288 closed defect (fixed)

Use F_FULLFSYNC ioctl where supported

Reported by: Richard Boulton Owned by: Olly Betts
Priority: high Milestone: 1.0.14
Component: Backend-Flint Version: SVN trunk
Severity: normal Keywords:
Cc: James Aylett Blocked By:
Blocking: Operating System: Mac OS X

Description

I've recently noticed that, when performing an fsync, sqlite and mysql use a special ioctl on OS X which makes an effort to ensure that the disk's internal write buffers are flushed to the platters. Perhaps we should be using this ioctl too.

http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072.html has some details about why this is needed.

http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/os_unix.c&v=1.195 contains the sqlite implementation; search for the "full_fsync" function.

Change History (7)

comment:1 by Olly Betts, 14 years ago

Milestone: 1.1.1
Operating System: AllMac OS X
Status: newassigned

Definitely worth considering.

comment:2 by Olly Betts, 13 years ago

Milestone: 1.1.11.1.4

Triaging milestone:1.1.1 bugs.

comment:3 by Olly Betts, 13 years ago

Milestone: 1.1.41.1.2
Priority: normalhigh

Probably worthwhile and an easy change, though could be bumped. I'm going to either try to do this soon for 1.1.2, otherwise I think postpone it.

comment:4 by Olly Betts, 13 years ago

Cc: James Aylett added

Fixed in trunk r13007 for chert, but I don't have OS X to test on.

Cc:ing James - can you try xapian-core trunk r13007 or higher on OS X?

comment:5 by James Aylett, 13 years ago

All is well with this patch.

comment:6 by Olly Betts, 13 years ago

Component: Backend-ChertBackend-Flint
Milestone: 1.1.21.0.14
Resolution: fixed
Status: assignedclosed

Backported for flint on trunk as r13011.

Then backported that for 1.0.14 as r13012.

comment:7 by Olly Betts, 8 years ago

As of trunk r18193, we're no longer using F_FULLSYNC by default, though it can be enabled with Xapian::DB_FULL_SYNC (currently only supported by brass).

Also, brass on trunk only does the full-sync on the final file, and just fdatasync() the others, which will probably make quite a difference to the slowdown, but we've not yet tested this.

Note: See TracTickets for help on using tickets.