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