You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PATCH - Providing fullfsync on supported platforms #47767
Python currently provides os.fsync to call the POSIX 'fsync' on
platforms that support it. While this function forces the operating
system to force a file buffer to the storage device, data may still be
waiting in the hardware write buffers on the storage device. Certain
platforms (so far, only OS X) provide "fullfsync" [1] to request that
storage devices flush their write buffers to the actual physical media.
This functionality is especially useful to VCS and DB developers, and
already appears in SQLite [2] and MySQL [3], amongst others.
This patch includes code changes to Modules/posixmodule.c that exposes
os.fullfsync on supported platforms, including the appropriate
documentation added to Doc/library/os.rst
[3] MySQL uses fullfsync only on the darwin platform and only when
F_FULLFSYNC is defined as 51, which seems to be short-sighted in that
this symbol may change value in future versions of OS X. To see this
code, download a mysql 5.x source snapshot and open up
mysql-<version-number>/innobase/os/os0file.c
I'm sorry to have lead you this way, but since there is no fullfsync()
system call, IMO you should just make the F_FULLFSYNC constant
available. That should go into fcntlmodule.c.
icharnas commented on Aug 7, 2008
icharnasmannequin
MannequinAuthor
More actions
Sounds fair enough. I was looking forward to the glitz and glamor of
the os module, but I'll settle for a good seat in fcntl. Here's a patch
implementing just that.
Activity
icharnas commentedon Aug 7, 2008
Python currently provides os.fsync to call the POSIX 'fsync' on
platforms that support it. While this function forces the operating
system to force a file buffer to the storage device, data may still be
waiting in the hardware write buffers on the storage device. Certain
platforms (so far, only OS X) provide "fullfsync" [1] to request that
storage devices flush their write buffers to the actual physical media.
This functionality is especially useful to VCS and DB developers, and
already appears in SQLite [2] and MySQL [3], amongst others.
This patch includes code changes to Modules/posixmodule.c that exposes
os.fullfsync on supported platforms, including the appropriate
documentation added to Doc/library/os.rst
-Ian Charnas
[1] Discussion of fsync and fullfsync on darwin platform:
http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072.html
[2] SQLite uses fullfsync on all platforms that define it:
http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/os_unix.c
[3] MySQL uses fullfsync only on the darwin platform and only when
F_FULLFSYNC is defined as 51, which seems to be short-sighted in that
this symbol may change value in future versions of OS X. To see this
code, download a mysql 5.x source snapshot and open up
mysql-<version-number>/innobase/os/os0file.c
gvanrossum commentedon Aug 7, 2008
I'm sorry to have lead you this way, but since there is no fullfsync()
system call, IMO you should just make the F_FULLFSYNC constant
available. That should go into fcntlmodule.c.
icharnas commentedon Aug 7, 2008
Sounds fair enough. I was looking forward to the glitz and glamor of
the os module, but I'll settle for a good seat in fcntl. Here's a patch
implementing just that.
-ian
gvanrossum commentedon Aug 7, 2008
Thanks, checked into the trunk as r65581.