reduce_data_loss_v1.patch

application/octet-stream

Filename: reduce_data_loss_v1.patch
Type: application/octet-stream
Part: 0
Message: Reduce the amount of data loss on the standby

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 v1
File+
src/backend/access/transam/xlog.c 6 0
*** 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;