calm_down_retries_v2.patch

text/x-diff

Filename: calm_down_retries_v2.patch
Type: text/x-diff
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: unified
Series: patch v2
File+
src/backend/access/transam/xlog.c 16 0
--- src/backend/access/transam/xlog.c	10 Jun 2010 08:13:50 -0000	1.422
+++ src/backend/access/transam/xlog.c	11 Jun 2010 12:30:36 -0000
@@ -9271,6 +9271,22 @@
 				if (WalRcvInProgress())
 				{
 					/*
+					 * If we find an invalid record in the WAL streamed from
+					 * master, something is seriously wrong. There's little
+					 * chance that the problem will just go away, but PANIC
+					 * is not good for availability either, especially in
+					 * hot standby mode. Disconnect, and retry from
+					 * archive/pg_xlog again. The WAL in the archive should
+					 * be identical to what was streamed, so it's unlikely
+					 * that it helps, but one can hope...
+					 */
+					if (failedSources & XLOG_FROM_STREAM)
+					{
+						ShutdownWalRcv();
+						continue;
+					}
+
+					/*
 					 * While walreceiver is active, wait for new WAL to arrive
 					 * from primary.
 					 */