postgresql/src/include/common
Michael Paquier 8b938d36f7 Refactor more code logic to update the control file
ce6afc6 has begun the refactoring work by plugging pg_rewind into a
central routine to update the control file, and left around two extra
copies, with one in xlog.c for the backend and one in pg_resetwal.c.  By
adding an extra option to the central routine in controldata_utils.c to
control if a flush of the control file needs to be done, it is proving
to be straight-forward to make xlog.c and pg_resetwal.c use the central
code path at the condition of moving the wait event tracking there.
Hence, this allows to have only one central code path to update the
control file, shaving the code from the duplicates.

This refactoring actually fixes a problem in pg_resetwal.  Previously,
the control file was first removed before being recreated.  So if a
crash happened between the moment the file was removed and the moment
the file was created, then it would have been possible to not have a
control file anymore in the database folder.

Author: Fabien Coelho
Reviewed-by: Michael Paquier
Discussion: https://postgr.es/m/alpine.DEB.2.21.1903170935210.2506@lancre
2019-03-18 12:59:35 +09:00
..
base64.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
config_info.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
controldata_utils.h Refactor more code logic to update the control file 2019-03-18 12:59:35 +09:00
fe_memutils.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_perm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
file_utils.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
int.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
int128.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
ip.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
keywords.h Replace the data structure used for keyword lookup. 2019-01-06 17:02:57 -05:00
kwlookup.h Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
link-canary.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
md5.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_lzcompress.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
relpath.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
restricted_token.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
saslprep.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
scram-common.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
sha2.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
shortest_dec.h Change floating-point output format for improved performance. 2019-02-13 15:20:33 +00:00
string.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
unicode_norm.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
unicode_norm_table.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
username.h Update copyright for 2019 2019-01-02 12:44:25 -05:00