You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
pg_upgrade: Move all the files generated internally to a subdirectory
Historically, the location of any files generated by pg_upgrade, as ofthe per-database logs and internal dumps, has been the current workingdirectory, leaving all those files behind when using --retain or on afailure.Putting all those contents in a targeted subdirectory makes the wholeeasier to debug, and simplifies the code in charge of cleaning up thelogs. Note that another reason is that this facilitates the move ofpg_upgrade to TAP with a fixed location for all the logs to grab if thetest fails repeatedly.Initially, we thought about being able to specify the output directorywith a new option, but we have settled on using a subdirectory locatedat the root of the new cluster's data folder, "pg_upgrade_output.d",instead, as at the end the new data directory is the location of all thedata generated by pg_upgrade. There is a take with group permissionshere though: if the new data folder has been initialized with thisoption, we need to create all the files and paths with the correctpermissions or a base backup taken after a pg_upgrade --retain wouldfail, meaning that GetDataDirectoryCreatePerm() has to be called beforecreating the log paths, before a couple of sanity checks on the clustersand before getting the socket directory for the cluster's host settings.The idea of the new location is based on a suggestion from PeterEisentraut.Also thanks to Andrew Dunstan, Peter Eisentraut, Daniel Gustafsson, TomLane and Bruce Momjian for the discussion (in alphabetical order).Author: Justin PryzbyDiscussion:https://postgr.es/m/20211212025017.GN17618@telsasoft.com