diff options
author | Bruce Momjian <bruce@momjian.us> | 2018-01-08 22:43:51 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2018-01-08 22:43:51 -0500 |
commit | d25ee30031b08ad1348a090914c2af6bc640a832 (patch) | |
tree | d71669dc77e79e309c4f56a3000098423f184108 /src/bin/pg_upgrade/parallel.c | |
parent | e35dba475a440f73dccf9ed1fd61e3abc6ee61db (diff) |
pg_upgrade: prevent check on live cluster from generating error
Previously an inaccurate but harmless error was generated when running
--check on a live server before reporting the servers as compatible.
The fix is to split error reporting and exit control in the exec_prog()
API.
Reported-by: Daniel Westermann
Backpatch-through: 10
Diffstat (limited to 'src/bin/pg_upgrade/parallel.c')
-rw-r--r-- | src/bin/pg_upgrade/parallel.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bin/pg_upgrade/parallel.c b/src/bin/pg_upgrade/parallel.c index cb1dc434f64..23f869f6c7b 100644 --- a/src/bin/pg_upgrade/parallel.c +++ b/src/bin/pg_upgrade/parallel.c @@ -78,8 +78,8 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file, va_end(args); if (user_opts.jobs <= 1) - /* throw_error must be true to allow jobs */ - exec_prog(log_file, opt_log_file, true, "%s", cmd); + /* exit_on_error must be true to allow jobs */ + exec_prog(log_file, opt_log_file, true, true, "%s", cmd); else { /* parallel */ @@ -122,7 +122,7 @@ parallel_exec_prog(const char *log_file, const char *opt_log_file, child = fork(); if (child == 0) /* use _exit to skip atexit() functions */ - _exit(!exec_prog(log_file, opt_log_file, true, "%s", cmd)); + _exit(!exec_prog(log_file, opt_log_file, true, true, "%s", cmd)); else if (child < 0) /* fork failed */ pg_fatal("could not create worker process: %s\n", strerror(errno)); @@ -160,7 +160,7 @@ win32_exec_prog(exec_thread_arg *args) { int ret; - ret = !exec_prog(args->log_file, args->opt_log_file, true, "%s", args->cmd); + ret = !exec_prog(args->log_file, args->opt_log_file, true, true, "%s", args->cmd); /* terminates thread */ return ret; @@ -187,7 +187,6 @@ parallel_transfer_all_new_dbs(DbInfoArr *old_db_arr, DbInfoArr *new_db_arr, #endif if (user_opts.jobs <= 1) - /* throw_error must be true to allow jobs */ transfer_all_new_dbs(old_db_arr, new_db_arr, old_pgdata, new_pgdata, NULL); else { |