Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using syncfs() in frontend utilities.
This commit allows specifying a --sync-method in several frontend utilities that must synchronize many files to disk (initdb, pg_basebackup, pg_checksums, pg_dump, pg_rewind, and pg_upgrade). On Linux, users can specify "syncfs" to synchronize the relevant file systems instead of calling fsync() for every single file. In many cases, using syncfs() is much faster. As with recovery_init_sync_method, this new option comes with some caveats. The descriptions of these caveats have been moved to a new appendix section in the documentation. Co-authored-by: Justin Pryzby Reviewed-by: Michael Paquier, Thomas Munro, Robert Haas, Justin Pryzby Discussion: https://postgr.es/m/20210930004340.GM831%40telsasoft.com
- Loading branch information
1 parent
cccc6cd
commit 8c16ad3
Showing
21 changed files
with
271 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!-- doc/src/sgml/syncfs.sgml --> | ||
|
||
<appendix id="syncfs"> | ||
<title><function>syncfs()</function> Caveats</title> | ||
|
||
<indexterm zone="syncfs"> | ||
<primary>syncfs</primary> | ||
</indexterm> | ||
|
||
<para> | ||
On Linux <function>syncfs()</function> may be specified for some | ||
configuration parameters (e.g., | ||
<xref linkend="guc-recovery-init-sync-method"/>), server applications (e.g., | ||
<application>pg_upgrade</application>), and client applications (e.g., | ||
<application>pg_basebackup</application>) that involve synchronizing many | ||
files to disk. <function>syncfs()</function> is advantageous in many cases, | ||
but there are some trade-offs to keep in mind. | ||
</para> | ||
|
||
<para> | ||
Since <function>syncfs()</function> instructs the operating system to | ||
synchronize a whole file system, it typically requires many fewer system | ||
calls than using <function>fsync()</function> to synchronize each file one by | ||
one. Therefore, using <function>syncfs()</function> may be a lot faster than | ||
using <function>fsync()</function>. However, it may be slower if a file | ||
system is shared by other applications that modify a lot of files, since | ||
those files will also be written to disk. | ||
</para> | ||
|
||
<para> | ||
Furthermore, on versions of Linux before 5.8, I/O errors encountered while | ||
writing data to disk may not be reported to the calling program, and relevant | ||
error messages may appear only in kernel logs. | ||
</para> | ||
|
||
</appendix> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.