postgresql/src/backend/access
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
..
brin More unconstify use 2019-02-13 11:50:16 +01:00
common Move hash_any prototype from access/hash.h to utils/hashutils.h 2019-03-11 13:17:50 -03:00
gin Fix misc typos in comments. 2019-01-23 13:39:00 +02:00
gist tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
hash tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
heap tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
index tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
nbtree Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
rmgrdesc Fix description of WAL record XLOG_PARAMETER_CHANGE 2019-02-12 13:10:59 +09:00
spgist tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
table tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
tablesample tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
transam Refactor more code logic to update the control file 2019-03-18 12:59:35 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00