Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMYcq-0002TV-8u for pgsql-admin@arkaria.postgresql.org; Tue, 13 Nov 2018 13:21:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMYco-00038l-06 for pgsql-admin@arkaria.postgresql.org; Tue, 13 Nov 2018 13:21:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMYcn-00038b-Ld for pgsql-admin@lists.postgresql.org; Tue, 13 Nov 2018 13:21:01 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMYcj-0004Of-Bk for pgsql-admin@lists.postgresql.org; Tue, 13 Nov 2018 13:21:00 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id wADDKmGK011836 for ; Tue, 13 Nov 2018 15:20:53 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id wADDKm8S004790 for ; Tue, 13 Nov 2018 15:20:48 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: PostgreSQL 10.5 : Logical replication timeout results in PANIC in pg_wal "No space left on device" To: pgsql-admin@lists.postgresql.org References: <838a3914-a078-88eb-ee5e-4059b7d14620@matrix.gatewaynet.com> From: Achilleas Mantzios Message-ID: <4bdf3996-31c0-d9ec-274c-225b78683f6f@matrix.gatewaynet.com> Date: Tue, 13 Nov 2018 15:20:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0.1 MIME-Version: 1.0 In-Reply-To: <838a3914-a078-88eb-ee5e-4059b7d14620@matrix.gatewaynet.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-29.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 13/11/18 2:00 μ.μ., Achilleas Mantzios wrote: > On 12/11/18 12:41 μ.μ., Achilleas Mantzios wrote: >> Hello, >> while setting up logical replication since August we had seen early on the need to increase max_receiver_timeout and max_sender_timeout from 60sec to 5mins, otherwise the synchronization would >> never take place. >> This Sunday (yesterday) we had an incident caused by wal sender terminating (on Friday) after reaching timeout (5 mins). This left the replication slot retaining wals till our production primary >> server run out of space. (this is not connected with the wal fill up of the previous Sunday nor does it explain why it happened, still in the dark about this one). >> >> I got the following messages on the publisher (primary) host : >> >> 10.9.0.77(48650) [65253] 5be2ca1d.fee5 2018-11-09 15:06:11.052 EET data_for_testsmadb_pub repmgr@dynacom line:9 LOG: terminating walsender process due to replication timeout >> 10.9.0.77(48650) [65253] 5be2ca1d.fee5 2018-11-09 15:06:11.052 EET data_for_testsmadb_pub repmgr@dynacom line:10 CONTEXT:  slot "data_for_testsmadb_pub", output plugin "pgoutput", in the change >> callback, associated LSN 13DF/393BF7F0 >> 10.9.0.77(48650) [65253] 5be2ca1d.fee5 2018-11-09 15:06:11.066 EET data_for_testsmadb_pub repmgr@dynacom line:11 LOG: disconnection: session time: 49:47:17.937 user=repmgr database=dynacom >> host=10.9.0.77 port=48650 >> >> By querying pg_stat_subscription all 3 timestamps were about 5 mins prior to the above walsender termination. >> >> I didn't get *any* ERROR/FATAL message on the subscriber side. We have built a monitoring system that notifies us about problems, conflicts such as unique key violations, etc but we had no alerts >> coming from the subscriber logs. So this went unnoticed. Also the scripts about disk size growth fired but this was already too late. > > > Just a thought : > could it be related to https://groups.google.com/a/2ndquadrant.com/forum/#!topic/bdr-list/YDG1_MuvfVM , i.e. : https://commitfest.postgresql.org/14/1151/ Just saw the above patch was already committed to 10.2 , so it must be something else. > ? > Is there a way for the WAL receiver to not have detected the termination of the replication stream? > Shouldn't normally the WAL receiver detect this and try again in wal_retrieve_retry_interval ? > > We checked with our cloud provider, they replied that there were no outages at all. > > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt