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.92) (envelope-from ) id 1jC5cC-0004MD-EW for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 17:57:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jC5cA-0006hh-40 for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 17:57:54 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jC5c9-0006gx-Q5 for pgsql-general@lists.postgresql.org; Wed, 11 Mar 2020 17:57:53 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jC5c7-0005o7-B8 for pgsql-general@postgresql.org; Wed, 11 Mar 2020 17:57:53 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 0E1CD453; Wed, 11 Mar 2020 13:57:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 11 Mar 2020 13:57:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=R O8IPJ/G3sS10zpBzPNvwUTjvk/yrcy/1UQiizuTbhU=; b=UZD15He95mOemTM4o SU22DhKBN60odCL+zJvIFS/+zWgFhV2sHrfQOb7XHNKd/j3YozqPrOCk8Ps3YUqq PPUaak2wm4s9rIRBI3/fEIRWuNth2KLFuLoWdyJ2eNkU+xdPtMo4OMzyZ+iPMwLY lWJ/AuF+nYwRCPJ/GRZNuFzS8eCtWFS8yrhj9hGXhlEl3+zo9SrL36oUler7Pqd9 PMXANSjedNYYITWsKMj2kefEz3w/fJg4lwyL4Dd2/IN/3Hh2hpUPKmhYiL4fDMxb 97NgjLP5vj2AwzCNb6dSs3xuYqBBtgyD+fdmXwTykaKyrUQJ8EBPEThgYEvHKWMv 9VigQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=RO8IPJ/G3sS10zpBzPNvwUTjvk/yrcy/1UQiizuTb hU=; b=w0tHL1qb8HEhzRz90jFm3UMXLfJiLw2lMdzRZMzlYp/0nTwfqD6qP9yCE uXCxb5xDJ44X7wcHipvJBee3C7ilNT1oW7ZZjejrSKs5jxdCQfwhB6dftGbTNY2Y rIdEJ68oHq3TYZWHe4V6EzSDM15rq4UQulEO2Lo8rmJ/mEUfq7+av82Snv4O6GN+ 0sFecPfC3cQUsCAMpnY9TnBGL/jk2ho0HfoD3Epv+RJ6NvU3QMa11CbVC2nZmN/i XS8lE6njunSawO6nVeKz9pxURg+qRWQh2cecF/mtRh6HgMId3pto1/1Fw9lgLOEl XYCzxX7HK6tjdkrsGuK3wS55FhQyA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvvddguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecukfhppeejgedrleegrdejfedrvddvvdenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrg hvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 99DAA328006A; Wed, 11 Mar 2020 13:57:47 -0400 (EDT) Subject: Re: Streaming replication - 11.5 To: Nicola Contu Cc: pgsql-general References: <89a1e4cd-1da5-7233-d8c3-5e19cc9d1b75@aklaver.com> <1fdd13a5-d38b-8040-8261-c866bd782bd5@aklaver.com> From: Adrian Klaver Message-ID: Date: Wed, 11 Mar 2020 10:57:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/11/20 2:54 AM, Nicola Contu wrote: > These are the lines before > > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [1-1] > db=cmdv3,user=zabbix_check ERROR:  recovery is in progress > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [2-1] > db=cmdv3,user=zabbix_check HINT:  WAL control functions cannot be > executed during recovery. > 2020-03-11 09:05:08 GMT [127.0.0.1(40214)] [43853]: [3-1] > db=cmdv3,user=zabbix_check STATEMENT:  select > greatest(0,pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn)) from > pg_stat_replication where client_addr ='10.150.20.22' > > That query is made by Zabbix. So I stopped the zabbix agent and tested > again. But still failing, because of this now : > > pg_basebackup: starting background WAL receiver > pg_basebackup: created temporary replication slot "pg_basebackup_51199" > *pg_basebackup: could not receive data from WAL stream: SSL SYSCALL > error: EOF detected > *^C4699810/504983062 kB (70%), 0/1 tablespace > (...ql11/data/base/16401/231363544.2) So you started over with a pg_basebackup? Also from below: 2020-03-11 09:43:53 GMT [10.150.20.22(54906)] [51199]: [1-1] db=[unknown],user=replicator LOG: terminating walsender process due to replication timeout Where are the master and standby in relation to each other network wise? Intervening firewalls, network latency issues? > > > here the full log starting right before the last try : > > 2020-03-11 09:22:44 GMT [] [12598]: [4508-1] db=,user= LOG: >  restartpoint complete: wrote 19565 buffers (0.2%); 0 WAL file(s) > added, 0 removed, 7 recycled; write=270.014 s, sync=0.009 s, > total=270.036 s; sync files=804, longest=0.001 s, average=0.000 s; > distance=131239 kB, estimate=725998 kB > 2020-03-11 09:22:44 GMT [] [12598]: [4509-1] db=,user= LOG:  recovery > restart point at 643A/D8C05F70 > 2020-03-11 09:22:44 GMT [] [12598]: [4510-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:22:44.050084+00. > 2020-03-11 09:23:14 GMT [] [12598]: [4511-1] db=,user= LOG: >  restartpoint starting: time > 2020-03-11 09:27:44 GMT [] [12598]: [4512-1] db=,user= LOG: >  restartpoint complete: wrote 17069 buffers (0.2%); 0 WAL file(s) > added, 0 removed, 17 recycled; write=269.879 s, sync=0.006 s, > total=269.902 s; sync files=811, longest=0.001 s, average=0.000 s; > distance=120469 kB, estimate=665445 kB > 2020-03-11 09:27:44 GMT [] [12598]: [4513-1] db=,user= LOG:  recovery > restart point at 643A/E01AB438 > 2020-03-11 09:27:44 GMT [] [12598]: [4514-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:27:43.945485+00. > 2020-03-11 09:27:44 GMT [] [12598]: [4515-1] db=,user= LOG: >  restartpoint starting: force wait > 2020-03-11 09:29:24 GMT [10.222.8.2(47834)] [50961]: [1-1] > db=cmdv3,user=nis LOG:  duration: 1402.004 ms  statement: SELECT id, > name, parent_id, parent, short_name, sales_rep_id FROM mmx_clients; > 2020-03-11 09:29:34 GMT [10.222.8.2(47834)] [50961]: [2-1] > db=cmdv3,user=nis LOG:  duration: 9493.259 ms  statement: SELECT slid, > gnid, sof_id, client_id, product FROM mmx_slids; > 2020-03-11 09:32:14 GMT [] [12598]: [4516-1] db=,user= LOG: >  restartpoint complete: wrote 71260 buffers (0.8%); 0 WAL file(s) > added, 0 removed, 13 recycled; write=269.953 s, sync=0.012 s, > total=269.979 s; sync files=760, longest=0.002 s, average=0.000 s; > distance=123412 kB, estimate=611242 kB > 2020-03-11 09:32:14 GMT [] [12598]: [4517-1] db=,user= LOG:  recovery > restart point at 643A/E7A30498 > 2020-03-11 09:32:14 GMT [] [12598]: [4518-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:32:13.916101+00. > 2020-03-11 09:32:44 GMT [] [12598]: [4519-1] db=,user= LOG: >  restartpoint starting: time > 2020-03-11 09:37:14 GMT [] [12598]: [4520-1] db=,user= LOG: >  restartpoint complete: wrote 27130 buffers (0.3%); 0 WAL file(s) > added, 0 removed, 12 recycled; write=270.026 s, sync=0.007 s, > total=270.052 s; sync files=814, longest=0.001 s, average=0.000 s; > distance=280595 kB, estimate=578177 kB > 2020-03-11 09:37:14 GMT [] [12598]: [4521-1] db=,user= LOG:  recovery > restart point at 643A/F8C351C8 > 2020-03-11 09:37:14 GMT [] [12598]: [4522-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:37:14.067443+00. > 2020-03-11 09:37:44 GMT [] [12598]: [4523-1] db=,user= LOG: >  restartpoint starting: time > 2020-03-11 09:42:14 GMT [] [12598]: [4524-1] db=,user= LOG: >  restartpoint complete: wrote 26040 buffers (0.3%); 0 WAL file(s) > added, 0 removed, 9 recycled; write=269.850 s, sync=0.019 s, > total=269.886 s; sync files=834, longest=0.002 s, average=0.000 s; > distance=236392 kB, estimate=543999 kB > 2020-03-11 09:42:14 GMT [] [12598]: [4525-1] db=,user= LOG:  recovery > restart point at 643B/730F3F8 > 2020-03-11 09:42:14 GMT [] [12598]: [4526-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:42:13.900088+00. > 2020-03-11 09:42:44 GMT [] [12598]: [4527-1] db=,user= LOG: >  restartpoint starting: time > 2020-03-11 09:43:53 GMT [10.150.20.22(54906)] [51199]: [1-1] > db=[unknown],user=replicator LOG:  terminating walsender process due to > replication timeout > 2020-03-11 09:47:14 GMT [] [12598]: [4528-1] db=,user= LOG: >  restartpoint complete: wrote 20966 buffers (0.2%); 0 WAL file(s) > added, 0 removed, 9 recycled; write=270.048 s, sync=0.014 s, > total=270.085 s; sync files=852, longest=0.001 s, average=0.000 s; > distance=183749 kB, estimate=507974 kB > 2020-03-11 09:47:14 GMT [] [12598]: [4529-1] db=,user= LOG:  recovery > restart point at 643B/12680A80 > 2020-03-11 09:47:14 GMT [] [12598]: [4530-1] db=,user= DETAIL:  Last > completed transaction was at log time 2020-03-11 09:47:14.069731+00. > 2020-03-11 09:47:44 GMT [] [12598]: [4531-1] db=,user= LOG: >  restartpoint starting: time > > > > Il giorno mer 11 mar 2020 alle ore 01:53 Adrian Klaver > > ha scritto: > > On 3/10/20 8:17 AM, Nicola Contu wrote: > Please post to list also. > Ccing list. > > What came immediately before the temporary file error? > > >    2020-03-10 15:10:17 GMT [[local]] [28171]: [1-1] > > db=postgres,user=postgres LOG:  temporary file: path > > "base/pgsql_tmp/pgsql_tmp28171.0", size 382474936 > > 2020-03-10 15:10:17 GMT [[local]] [28171]: [4-1] > > db=postgres,user=postgres LOG:  could not send data to client: > Broken pipe > > 2020-03-10 15:10:17 GMT [[local]] [28171]: [5-1] > > db=postgres,user=postgres FATAL:  connection to client lost > > 2020-03-10 15:10:26 GMT [] [12598]: [3544-1] db=,user= LOG: > >   restartpoint complete: wrote 37315 buffers (0.4%); 0 WAL file(s) > > added, 0 removed, 16 recycled; write=269.943 s, sync=0.039 s, > > total=269.999 s; sync files=1010, longest=0.001 s, average=0.000 s; > > distance=175940 kB, estimate=416149 kB > > 2020-03-10 15:10:26 GMT [] [12598]: [3545-1] db=,user= LOG: >  recovery > > restart point at 6424/1D7DEDE8 > > > > It is a cascade replication > > > > Il giorno mar 10 mar 2020 alle ore 15:58 Adrian Klaver > > > >> ha scritto: > > > >     On 3/10/20 2:26 AM, Nicola Contu wrote: > >      > Hello, > >      > I have two servers connected to the same switch running > postgres 11.5 > >      > > >      > I am trying to replicate one of those servers after a planned > >     work on > >      > the master, so the replica has been lost. It has always worked > >     but now I > >      > get this : > >      > > >      > pg_basebackup: could not receive data from WAL stream: server > >     closed the > >      > connection unexpectedly > >      >          This probably means the server terminated abnormally > >      >          before or while processing the request. > >      > > >      > I don't really understand what the issue is. > > > >     I would start with the logs from the Postgres server you are > taking the > >     backup from. > > > >      > I had this issue last week as well in another DC and I had to > >     reboot the > >      > slave to make it working (not sure why it helped) > >      > > >      > Do you know what can cause this? > >      > > >      > Thank you, > >      > Nicola > > > > > >     -- > >     Adrian Klaver > > adrian.klaver@aklaver.com > > > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com