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 1faFs7-0002BV-9K for pgsql-admin@arkaria.postgresql.org; Tue, 03 Jul 2018 07:37:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1faFs5-0001Eo-Ju for pgsql-admin@arkaria.postgresql.org; Tue, 03 Jul 2018 07:37:09 +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 1faFs5-0001Ef-Ad for pgsql-admin@lists.postgresql.org; Tue, 03 Jul 2018 07:37:09 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1faFs2-0004BP-K2 for pgsql-admin@lists.postgresql.org; Tue, 03 Jul 2018 07:37:08 +0000 Received: by mail-lf0-x234.google.com with SMTP id l16-v6so769716lfc.13 for ; Tue, 03 Jul 2018 00:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wB56KX1N8BvvQbI6/s+Wv3l7wJD4YwTA1RVzdhm82N4=; b=KAlKXlS1vt8uRN+m8WVSb0DqkguJFoM6cCUmNXFjOe6+oSEvVYKoyiDqN/2CquME7s EfGaIFte3tCCKTRHDUoJT+xyi8U/t4mXixOZac2SjZe6zNcuiB/MH7uTEyu6Ffzqw6ql hE/Ph7SncdlQXPEKaJhRZU0JTjGWM1RcifDIKWz+IkzBZhg7ZhJk3V9WgmRb5+qsrkV0 YlJ3BoMgmCT048NPlbtDS7uZMSibn3Zr0ehPPWgkn4zf/KTfh0zPAtuIHBk2vAeDiWZC 3x2UkXOI4z3rruffuTiGvc442JYRAW0e/hjn/6DUXJ/v42MRY8e6aCOLMCJe8a99W0U0 sMrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wB56KX1N8BvvQbI6/s+Wv3l7wJD4YwTA1RVzdhm82N4=; b=uNuJRBvSEPoW8virHoVmC6L8Xaf0mSOz0/2RjximlSouyUJQhE7iRRQE++xszdHTr/ MFrLXlMQguV+99DxXicsFKQ3DcjEUx6vCxFRrYlo0kcqeciHy7Uo6tpHVH8zXkieh54L PuwJeIi38NQmrw/kLHWV9APohA2HdMtRgD/w3u/mwC6yFKYRlQ25CPygtnOFVJdCFPYN wM6Y5F4I8IfCNucYQYbMHOQm2z4+IGV2AO/k2DymF5JZYVCoYepJ78I8ucUGHhZNAX1c 6V9by9JW5WO4NOAqZJ/aN9RtKqgsRAsfx1/au8wzN23WqLXzI4dt9xB0ETRY4W/yOz7V I7Mg== X-Gm-Message-State: APt69E2mKfZtxv5f3LKp245ty2SYhL79zlJbg8HSgOL+F5OK4vN/TbBF jiB1zti1JBe6MHG74JzUmmtaIP8yTqtZNHJRdcPvBw== X-Google-Smtp-Source: AAOMgpfxJbnSnmnCwhhsHtZbGAyhJEm67k2iB/+786F+2s//W4DqbehLzSKBadFBWGAsGDyEkueqlsqMyQ6tdLo1QM0= X-Received: by 2002:a19:138b:: with SMTP id 11-v6mr15601802lft.74.1530603424487; Tue, 03 Jul 2018 00:37:04 -0700 (PDT) MIME-Version: 1.0 References: <20180627131652.4zibah4oqscpkijh@vault.lan> In-Reply-To: From: Ganesh Korde Date: Tue, 3 Jul 2018 13:06:41 +0530 Message-ID: Subject: Re: Streaming replication connection break - unexpected EOF on standby connection To: johannes@truschnigg.info Cc: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000689d890570136127" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000689d890570136127 Content-Type: text/plain; charset="UTF-8" Hi, After analysis by network team, they found packets are getting reset by Secondary server. Below are the logs. 782.822280 port7 in .35918 -> .5433: rst 1232664740 782.822310 wan2 out .35918 -> .5433: rst 1232664740 782.822313 port7 in .35918 -> .5433: rst 1232664740 782.822315 wan2 out .35918 -> .5433: rst 1232664740 782.822317 port7 in .35918 -> .5433: rst 1232664740 782.822319 wan2 out .35918 -> .5433: rst 1232664740 782.822345 port7 in .35918 -> .5433: rst 1232664740 But they didn't able to find why secondary generating reset packet. There are no any devices between these servers which can modify the packets. Though both servers are on different firewall, but packets are getting reset at secondary server and not at the firewall level, we can see this in the log. Below points I would like to mention about application 1. This connection interruption happens in day time, when transactions are little bit high. In day time, average transactions per second are 5 (Inserts and processing). 2. We are not using connection pool, so each time request comes app server creates new connection to db server and when processing is done, app server disconnects. We are now clue less why secondary server resetting the packets. Any help is highly appreciated. Thanks & Regards, Ganesh. On Thu, Jun 28, 2018 at 3:38 PM Ganesh Korde wrote: > Hi Johannes, > > Thanks for your reply. We are using VPN Tunnel between these two hosts. > I will check with network team, with remaining questions you mentioned and > will get back. > > Thanks & Regards, > Ganesh. > > On Wed, Jun 27, 2018 at 6:46 PM Johannes Truschnigg < > johannes@truschnigg.info> wrote: > >> Hi Ganesh, >> >> >> On Wed, Jun 27, 2018 at 06:37:25PM +0530, Ganesh Korde wrote: >> > [...] >> > 1. Because of what reason, " unexpected EOF on standby connection" >> occurs >> > on primary db server? >> > 2. After replication disconnection, secondary should immediately >> connect to >> > primary, but it takes some time, what could be the reason for this? >> >> From skimming the log, it seems to me that there is an issue at the >> socket/network level, which yields the "connection reset by peer" eror >> message. >> >> What is the network between these two hosts like? Is it a WAN link; is a >> VPN >> or SSH tunnel involved? Do you have other, long-running TCP sessions >> between >> these peers, and do they experience similar or other problems? Do the >> hosts' >> link-layer stats hint at problems, e. g. packet loss? Do the hosts' >> kernels >> leave a message hinting at L2 connectivity problems in their debug >> ringbuffers >> (`dmesg`) at the time you observe the replication drop out? >> >> -- >> with best regards: >> - Johannes Truschnigg ( johannes@truschnigg.info ) >> >> www: https://johannes.truschnigg.info/ >> phone: +43 650 2 133337 >> xmpp: johannes@truschnigg.info >> >> Please do not bother me with HTML-email or attachments. Thank you. >> > --000000000000689d890570136127 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

=C2=A0 =C2=A0 After analysis by net= work team, they found packets are getting reset by Secondary server. Below = are the logs.

782.82= 2280 port7 in <Secondary_server_IP>.35918 -> <Primary_server_IP= >.5433: rst 1232664740

782.822310 wan2 out <Secondary_serv= er_IP>.35918 -> <Primary_server_IP>.5433: rst 1232664740=

782.822313 port7 in <Secondary_server_IP>.35918 -> <Primar= y_server_IP>.5433: rst 1232664740

782.822315 wan2 out <Sec= ondary_server_IP>.35918 -> <Primary_server_IP>.5433: rst 123266= 4740

782.822317 port7 in <Secondary_server_IP>.35918 ->= <Primary_server_IP>.5433: rst 1232664740

782.822319 wan= 2 out <Secondary_server_IP>.35918 -> <Primary_server_IP>.543= 3: rst 1232664740

782.822345 port7 in <Secondary_server_IP>= ;.35918 -> <Primary_server_IP>.5433: rst 1232664740<= /p>


But they didn't able to find why secondary= generating reset packet. There are no any devices between these servers wh= ich can modify the packets.
Though both servers are on different = firewall, but packets are getting reset at secondary server and not at the = firewall level, we can see this in the log.

Below = points I would like to mention about application=C2=A0
1. This co= nnection interruption happens in day time, when transactions are little bit= high. In day time, average transactions per second are 5 (Inserts and proc= essing).=C2=A0
2. We are not using connection pool, so each time = request comes app server creates new connection to db server and when proce= ssing is done, app server disconnects.=C2=A0

We ar= e now clue less why secondary server resetting the packets.=C2=A0 Any help = is highly appreciated.=C2=A0

Thanks & Regards,=
Ganesh.



=
On Thu, Jun 28, 2018 at 3:3= 8 PM Ganesh Korde <ganeshakord= e@gmail.com> wrote:
Hi=C2=A0 Johannes,

=C2=A0 Thanks for= your reply. We are using VPN Tunnel between these two hosts. I will check = with network team, with remaining questions you mentioned and will get back= .

Thanks= =C2=A0 & Regards,
Ganesh.

On Wed, Jun 27, 2018 at 6:46 PM Johannes Truschnigg= <johannes= @truschnigg.info> wrote:
Hi = Ganesh,


On Wed, Jun 27, 2018 at 06:37:25PM +0530, Ganesh Korde wrote:
> [...]
> 1. Because of what reason, " unexpected EOF on standby connection= " occurs
> on primary db server?
> 2. After replication disconnection, secondary should immediately conne= ct to
> primary, but it takes some time, what could be the reason for this?