mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
In pg_upgrade, only lock the old cluster if link mode is used, and do it
right after we restore the schema (a common failure point), and right before we do the link operation. Per suggesgtions from Robert and ^!C^!^@lvaro
This commit is contained in:
@ -516,11 +516,12 @@ check_control_data(ControlData *oldctrl,
|
||||
|
||||
|
||||
void
|
||||
rename_old_pg_control(void)
|
||||
disable_old_cluster(void)
|
||||
{
|
||||
char old_path[MAXPGPATH],
|
||||
new_path[MAXPGPATH];
|
||||
|
||||
/* rename pg_control so old server cannot be accidentally started */
|
||||
prep_status("Adding \".old\" suffix to old global/pg_control");
|
||||
|
||||
snprintf(old_path, sizeof(old_path), "%s/global/pg_control", old_cluster.pgdata);
|
||||
@ -528,4 +529,10 @@ rename_old_pg_control(void)
|
||||
if (pg_mv_file(old_path, new_path) != 0)
|
||||
pg_log(PG_FATAL, "Unable to rename %s to %s.\n", old_path, new_path);
|
||||
check_ok();
|
||||
|
||||
pg_log(PG_REPORT, "\n"
|
||||
"If you want to start the old cluster, you will need to remove\n"
|
||||
"the \".old\" suffix from %s/global/pg_control.old.\n"
|
||||
"Because \"link\" mode was used, the old cluster cannot be safely\n"
|
||||
"started once the new cluster has been started.\n\n", old_cluster.pgdata);
|
||||
}
|
||||
|
Reference in New Issue
Block a user