Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g80dV-0005mL-Fx for pgsql-admin@arkaria.postgresql.org; Thu, 04 Oct 2018 10:13:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g80dT-0008Ar-Dh for pgsql-admin@arkaria.postgresql.org; Thu, 04 Oct 2018 10:13:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g80dT-0008Ak-2Q for pgsql-admin@lists.postgresql.org; Thu, 04 Oct 2018 10:13:35 +0000 Received: from rollo.jernurt.dk ([2a01:4f8:161:8284::2]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g80dN-0001CE-2i for pgsql-admin@postgresql.org; Thu, 04 Oct 2018 10:13:34 +0000 Received: from localhost (localhost [127.0.0.1]) by rollo.jernurt.dk (Postfix) with ESMTP id C49E42341A4A for ; Thu, 4 Oct 2018 12:13:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at rollo.jernurt.dk Received: from rollo.jernurt.dk ([127.0.0.1]) by localhost (rollo.jernurt.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LN_F1zIOHSDh for ; Thu, 4 Oct 2018 12:13:26 +0200 (CEST) Received: from linuxawk.wegge.dk (xd4ed86c9.cust.hiper.dk [212.237.134.201]) by rollo.jernurt.dk (Postfix) with ESMTPSA id 3ACB22341A49 for ; Thu, 4 Oct 2018 12:13:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wegge.dk; s=mail; t=1538648006; bh=1Owwb35ar0w60wc1dil09Ygk4PMeABt5lD2ZbhooW88=; h=Date:From:To:Subject:From; b=rJgb2mAZPwHnkZYBb80Ncec6j3Tct+HzIuYdN3/kTlxozj4LQeAtnlgv8/63kPMdY O8CfgDrrohhOoNK8d0CJRspqUukO7UStwPNGhWS0vkMQcnvYCmqf70AUt3jfry8JNW 7nH17L5ThftttyrWvbmSh+8yAonRN0GZC6x1yjpA= Date: Thu, 4 Oct 2018 12:13:22 +0200 From: Anders Wegge Keller To: pgsql-admin@postgresql.org Subject: Detect when streaming replication stops streaming. Message-ID: <20181004121322.39ebda6c@linuxawk.wegge.dk> Organization: Disorganized X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Is there a reliable way to detect, on the standby, that continuous recovery have stopped for any reason? I'm adding a postgres 9.2(1) database to an industrial control system that have to run unattended. Thus, I need to plan for some really exotic failure modes, like e.g. loss of network connectivity in an indefinitely long period. On the master system, I can check for the existence of the proper row in pg_stat_replication. If that is missing, I can report a degraded status on the whole system. However, on the standby side, I've been unable to find something similar. Especially the failure mode where the standby return from a long period of no network connectivity, where the master no longer have the WAL segments needed to catch up. Snooping for FATAL in pg_log/Postgres-xxx is error prone, and I'd rather not go the route of polling the master system for a situation that should be detectable on the standby instance. -- //Wegge 1. Yes, I know it's no longer supported, but that's the way of redhat.