calm_down_retries_v1.patch

application/octet-stream

Filename: calm_down_retries_v1.patch
Type: application/octet-stream
Part: 0
Message: Re: warning message in 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 14 0
*** a/src/backend/access/transam/xlog.c
--- b/src/backend/access/transam/xlog.c
***************
*** 9271,9276 **** retry:
--- 9271,9290 ----
  				if (WalRcvInProgress())
  				{
  					/*
+ 					 * If we found an invalid record while streaming WAL from
+ 					 * master, we sleep for 5 seconds, before retrying to
+ 					 * replay the record which is in the same location where
+ 					 * the invalid one was found. Since such a retry is likely
+ 					 * to continue to fail, without the sleep, warning message
+ 					 * storm happens, and which would consume a lot of CPU load.
+ 					 */
+ 					if (failedSources & XLOG_FROM_STREAM)
+ 					{
+ 						pg_usleep(5000000L);
+ 						failedSources = 0;
+ 					}
+ 
+ 					/*
  					 * While walreceiver is active, wait for new WAL to arrive
  					 * from primary.
  					 */