Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdx7J-0003Qo-Px for pgsql-general@arkaria.postgresql.org; Fri, 22 Oct 2021 16:10:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mdx7I-0004Fi-HG for pgsql-general@arkaria.postgresql.org; Fri, 22 Oct 2021 16:10:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdx7I-0004FZ-73 for pgsql-general@lists.postgresql.org; Fri, 22 Oct 2021 16:10:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdx7G-0002O8-4J for pgsql-general@postgresql.org; Fri, 22 Oct 2021 16:09:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 19MG9tfQ2715483; Fri, 22 Oct 2021 12:09:55 -0400 From: Tom Lane To: Ninad Shah cc: Postgres General Subject: Re: Issue with pg_basebackup v.11 In-reply-to: References: Comments: In-reply-to Ninad Shah message dated "Fri, 22 Oct 2021 21:10:31 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2715481.1634918995.1@sss.pgh.pa.us> Date: Fri, 22 Oct 2021 12:09:55 -0400 Message-ID: <2715482.1634918995@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Ninad Shah writes: > What I observed is that it takes a couple of hours between below 2 lines. > 115454656/1304172127 kB (8%), 0/1 tablespace > (...atastaging/base/115868/154220.2) > pgbasebackup: could not read COPY data: could not receive data from server: > Connection timed out We have heard reports of network connections dropping while pg_basebackup is busy doing something disk-intensive such as fsync'ing. The apparent 2-hour delay here does not mean that pg_basebackup was out to lunch for 2 hours; more likely that reflects the TCP timeout delay before the kernel realizes that the connection is lost. The actual blame probably resides with some firewall or router that has a short timeout for idle connections. I'd try turning on fairly aggressive TCP keepalive settings for the connection, say keepalives_idle=30 or so. regards, tom lane