pgsql: Avoid torn copy of the control file in base backups

Поиск
Список
Период
Сортировка
Искать

pgsql: Avoid torn copy of the control file in base backups

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Avoid torn copy of the control file in base backups

Base backups read the control file (pg_control) from disk without any
protection against concurrent writes by the server, making it exposed to
torn copies.  Attempting to use such a control file at startup would
cause a failure with a CRC not matching.

Base backups now read the control file while holding ControlFileLock.
c558e6fd92f has done the same for some SQL functions.  The contents of
the file are saved in memory and sent over the wire as-is.

Backpatch down to v15.  This issue is older than v15 but v14 is left out
of the picture as it is going to be EOL soon, so it does not seem worth
taking a risk for.

Author: David Steele 
Reviewed-by: Heikki Linnakangas 
Discussion: https://postgr.es/m/d1697de1-eb7f-41bf-a4b7-bba7203df11f@pgbackrest.org
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e2c633b43b0efc1e3e4df1aab93a54479d297487

Modified Files
--------------
src/backend/backup/basebackup.c | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)

FAQ