warning_during_shutdown_v2.patch

application/octet-stream

Filename: warning_during_shutdown_v2.patch
Type: application/octet-stream
Part: 0
Message: Re: pg_ctl emits strange warning message

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
Series: patch v2
File+
src/bin/pg_ctl/pg_ctl.c 6 0
*** a/src/bin/pg_ctl/pg_ctl.c
--- b/src/bin/pg_ctl/pg_ctl.c
***************
*** 142,147 **** static char postopts_file[MAXPGPATH];
--- 142,148 ----
  static char pid_file[MAXPGPATH];
  static char conf_file[MAXPGPATH];
  static char backup_file[MAXPGPATH];
+ static char recovery_file[MAXPGPATH];
  
  #if defined(HAVE_GETRLIMIT) && defined(RLIMIT_CORE)
  static void unlimit_core_size(void);
***************
*** 802,808 **** do_stop(void)
  	}
  	else
  	{
! 		if ((shutdown_mode == SMART_MODE) && (stat(backup_file, &statbuf) == 0))
  		{
  			print_msg(_("WARNING: online backup mode is active\n"
  						"Shutdown will not complete until pg_stop_backup() is called.\n\n"));
--- 803,810 ----
  	}
  	else
  	{
! 		if ((shutdown_mode == SMART_MODE) && (stat(backup_file, &statbuf) == 0) &&
! 			(stat(recovery_file, &statbuf) != 0))
  		{
  			print_msg(_("WARNING: online backup mode is active\n"
  						"Shutdown will not complete until pg_stop_backup() is called.\n\n"));
***************
*** 879,885 **** do_restart(void)
  			exit(1);
  		}
  
! 		if ((shutdown_mode == SMART_MODE) && (stat(backup_file, &statbuf) == 0))
  		{
  			print_msg(_("WARNING: online backup mode is active\n"
  						"Shutdown will not complete until pg_stop_backup() is called.\n\n"));
--- 881,888 ----
  			exit(1);
  		}
  
! 		if ((shutdown_mode == SMART_MODE) && (stat(backup_file, &statbuf) == 0) &&
! 			(stat(recovery_file, &statbuf) != 0))
  		{
  			print_msg(_("WARNING: online backup mode is active\n"
  						"Shutdown will not complete until pg_stop_backup() is called.\n\n"));
***************
*** 1962,1967 **** main(int argc, char **argv)
--- 1965,1971 ----
  		snprintf(pid_file, MAXPGPATH, "%s/postmaster.pid", pg_data);
  		snprintf(conf_file, MAXPGPATH, "%s/postgresql.conf", pg_data);
  		snprintf(backup_file, MAXPGPATH, "%s/backup_label", pg_data);
+ 		snprintf(recovery_file, MAXPGPATH, "%s/recovery.conf", pg_data);
  	}
  
  	switch (ctl_command)