KeepFileRestoredFromArchive() called unlink() on an existing WAL segment before durable_rename() replaced it. rename(2) atomically replaces a target on POSIX systems, and the extra unlink() created a small window where it would be possible for a concurrent WAL sender to see a segment as missing. Note that the window still exists on WIN32, as we lack a safe concurrent alternative. Perhaps something like ReplaceFile() could be looked at for this purpose. This problem is hard to reach in practice, so no backpatch is done. I also tend to be conservative regarding recovery changes, even small, in stable branches. Author: Stepan Neretin <slpmcf@gmail.com> Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru> Reviewed-by: Neil Chen <carpenter.nail.cz@gmail.com> Discussion: https://postgr.es/m/CA+Yyo5S0C25jS_pRWQiGgoiy+X=GyJS7ZJkEq=_SW1WWpkL3Sg@mail.gmail.com
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.