postgresql/src/backend/postmaster
Fujii Masao 756e221db6 Reduce overhead of renaming archive status files.
Presently, archive status files are durably renamed from .ready to
.done to indicate that a file has been archived.  Persisting this
rename to disk accounts for a significant amount of the overhead
associated with archiving.  While durably renaming the file
prevents re-archiving in most cases, archive commands and libraries
must already gracefully handle attempts to re-archive the last
archived file after a crash (e.g., a crash immediately after
archive_command exits but before the server renames the status
file).

This change reduces the amount of overhead associated with
archiving by using rename() instead of durable_rename() to rename
the archive status files.  As a consequence, the server is more
likely to attempt to re-archive files after a crash, but as noted
above, archive commands and modules are already expected to handle
this.  It is also possible that the server will attempt to re-
archive files that have been removed or recycled, but the archiver
already handles this, too.

Author: Nathan Bossart
Reviewed-by: Kyotaro Horiguchi, Fujii Masao
Discussion: https://postgr.es/m/20220222011948.GA3850532@nathanxps13
2022-07-26 16:00:18 +09:00
..
Makefile pgstat: move pgstat.c to utils/activity. 2022-04-06 21:29:46 -07:00
autovacuum.c Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
auxprocess.c Revert the addition of GetMaxBackends() and related stuff. 2022-04-12 14:45:23 -04:00
bgworker.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
bgwriter.c pgstat: rename some pgstat_send_* functions to pgstat_report_*. 2022-04-06 14:08:57 -07:00
checkpointer.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
fork_process.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
interrupt.c pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
pgarch.c Reduce overhead of renaming archive status files. 2022-07-26 16:00:18 +09:00
postmaster.c Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
shell_archive.c Allow archiving via loadable modules. 2022-02-03 14:05:02 -05:00
startup.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
syslogger.c Use STDOUT/STDERR_FILENO in most of syslogger. 2022-07-18 17:22:11 -07:00
walwriter.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00