diff options
author | Fujii Masao <fujii@postgresql.org> | 2022-07-26 16:00:18 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2022-07-26 16:00:18 +0900 |
commit | 756e221db610f333649385f7fef96e7e9e23ed71 (patch) | |
tree | 66a5dc5b3b33701628993534a5bad4c1e9a1b92d /src/backend/tcop/postgres.c | |
parent | 27e0ee57f68d27af68967759a2ff61a581f501dc (diff) | |
download | postgresql-756e221db610f333649385f7fef96e7e9e23ed71.tar.gz postgresql-756e221db610f333649385f7fef96e7e9e23ed71.zip |
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
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions