*** 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.
  					 */
