pgjdbc logical replication client throwing exception

Started by sanyam jainover 8 years ago5 messages
#1sanyam jain
sanyamjain22@live.in

Hi,

I'm trying to create something like pg_recvlogical.c in java using pgjdbc.Its working for small transactions but when i do a big transaction client throws below exception:

org.postgresql.util.PSQLException: Database connection failed when reading from copy
at org.postgresql.core.v3.QueryExecutorImpl.readFromCopy(QueryExecutorImpl.java:1028)
at org.postgresql.core.v3.CopyDualImpl.readFromCopy(CopyDualImpl.java:41)
at org.postgresql.core.v3.replication.V3PGReplicationStream.receiveNextData(V3PGReplicationStream.java:150)
at org.postgresql.core.v3.replication.V3PGReplicationStream.readInternal(V3PGReplicationStream.java:119)
at org.postgresql.core.v3.replication.V3PGReplicationStream.readPending(V3PGReplicationStream.java:73)
at XLogApplier.main(XLogApplier.java:63)
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:191)
at org.postgresql.core.PGStream.receive(PGStream.java:495)
at org.postgresql.core.PGStream.receive(PGStream.java:479)
at org.postgresql.core.v3.QueryExecutorImpl.processCopyResults(QueryExecutorImpl.java:1161)
at org.postgresql.core.v3.QueryExecutorImpl.readFromCopy(QueryExecutorImpl.java:1026)
... 5 more

PG Server reports a broken pipe.
Can someone please tell what can be wrong?Its happening only when i add millions of rows.

Thanks,
Sanyam Jain

#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: sanyam jain (#1)
Re: pgjdbc logical replication client throwing exception

On 6/23/17 06:11, sanyam jain wrote:

I'm trying to create something like pg_recvlogical.c in java using
pgjdbc.Its working for small transactions but when i do a big
transaction client throws below exception:

What does the server log say? If nothing interesting, turn up debugging.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3sanyam jain
sanyamjain22@live.in
In reply to: Peter Eisentraut (#2)
Re: pgjdbc logical replication client throwing exception

Hi,

What does the server log say? If nothing interesting, turn up debugging.

I receive the following Log on server
LOG: could not send data to client: Broken pipe

Thanks,
Sanyam Jain

#4sanyam jain
sanyamjain22@live.in
In reply to: sanyam jain (#3)
Re: pgjdbc logical replication client throwing exception

Hi,

I suspect its happening because of delay in status update by client but even after trying forceUpdateStatus its quitting prematurely.

Thanks,

Sanyam Jain

________________________________
From: sanyam jain <sanyamjain22@live.in>
Sent: Tuesday, June 27, 2017 6:47:55 AM
To: Peter Eisentraut; Pg Hackers
Subject: Re: [HACKERS] pgjdbc logical replication client throwing exception

Hi,

What does the server log say? If nothing interesting, turn up debugging.

I receive the following Log on server
LOG: could not send data to client: Broken pipe

Thanks,
Sanyam Jain

#5dipesh
ddipeshdan@gmail.com
In reply to: sanyam jain (#4)
Re: pgjdbc logical replication client throwing exception

Hi,

I am also facing the same issue. Have you solved the problem?
Could you please guide me how to deal with it.

Thanks,
Dipesh

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers