*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
***************
*** 9460,9466 **** retry:
  					 * five seconds like in the WAL file polling case below.
  					 */
  					if (CheckForStandbyTrigger())
! 						goto triggered;
  
  					/*
  					 * Wait for more WAL to arrive, or timeout to be reached
--- 9460,9466 ----
  					 * five seconds like in the WAL file polling case below.
  					 */
  					if (CheckForStandbyTrigger())
! 						goto retry;
  
  					/*
  					 * Wait for more WAL to arrive, or timeout to be reached
***************
*** 9727,9732 **** static bool
--- 9727,9736 ----
  CheckForStandbyTrigger(void)
  {
  	struct stat stat_buf;
+ 	static bool	triggered = false;
+ 
+ 	if (triggered)
+ 		return true;
  
  	if (TriggerFile == NULL)
  		return false;
***************
*** 9737,9742 **** CheckForStandbyTrigger(void)
--- 9741,9747 ----
  				(errmsg("trigger file found: %s", TriggerFile)));
  		ShutdownWalRcv();
  		unlink(TriggerFile);
+ 		triggered = true;
  		return true;
  	}
  	return false;
