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 1gQALD-000571-67 for pgsql-admin@arkaria.postgresql.org; Fri, 23 Nov 2018 12:13:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gQALB-0001be-M6 for pgsql-admin@arkaria.postgresql.org; Fri, 23 Nov 2018 12:13:45 +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 1gQALB-0001XG-4W for pgsql-admin@lists.postgresql.org; Fri, 23 Nov 2018 12:13:45 +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 1gQAL2-0006Lg-GO for pgsql-admin@lists.postgresql.org; Fri, 23 Nov 2018 12:13:43 +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 wANCDQvU021001 for ; Fri, 23 Nov 2018 14:13:31 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id wANCDQjP043306 for ; Fri, 23 Nov 2018 14:13:26 +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: <20181123111024.73ck7f7zbzexfudz@alvherre.pgsql> From: Achilleas Mantzios Message-ID: Date: Fri, 23 Nov 2018 14:13:26 +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: <20181123111024.73ck7f7zbzexfudz@alvherre.pgsql> 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=-40.5 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_IT_PARTNERS,DYN_HAM_NAUTICAL,DYN_HAM_SHORT_BODY 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 Hi Alvaro! On 23/11/18 1:10 μ.μ., Alvaro Herrera wrote: > On 2018-Nov-14, Rui DeSousa wrote: > >>> On Nov 14, 2018, at 3:31 AM, Achilleas Mantzios wrote: >>> >>> Our sysadms (seasoned linux/network guys : we have been working here >>> for more than 10 yrs) were absolute in that we run no firewall or >>> other traffic shaping system between the two hosts. (if we did the >>> problem would manifest itself earlier). Can you recommend what to >>> look for exactly regarding both TCP stacks ? The subscriber node is >>> a clone of the primary. We have : >>> >>> # sysctl -a | grep -i keepaliv >>> net.ipv4.tcp_keepalive_intvl = 75 >>> net.ipv4.tcp_keepalive_probes = 9 >>> net.ipv4.tcp_keepalive_time = 7200 >> Those keep alive settings are linux’s defaults and work out to be 18 >> hours before the abandon connection is dropped. So, the WAL receiver >> should have corrected itself after that time. For reference, I run >> terminating abandon session within 15 mins as they take-up valuable >> database resources and could potentially hold on to locks, snapshots, >> etc. > Where does your 18h figure come from? As I understand it, these numbers > mean "wait 7200 seconds, then send 9 probes 75 seconds apart", kill the > connection if not reply is obtained. So that works out to about 131 > minutes (modulo fencepost bug). Certainly not 18 hours ... Thanks, yes it sums up to 2Hrs 11 Mins. The moments after the primary crushed I didn't have the nerves/patience/guts to wait that long and actually prove that the subscriber listened happily to a ghost/stuck connection. > > Now ... I have seen Linux kernel code that seemed to me to cause network > transmission get stuck *in the kernel* without any way out. Now I'm not > a kernel expert and I don't know if this applies to your case (maybe it > got fixed already), but it was definitely some process that was stuck > with "wchan" set to a network kernel call and way beyond TCP keepalives. It seems we'll have to upgrade our systems/kernels ASAP.  Thanks a lot! > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt