[HACKERS] Burst in WAL size when UUID is used as PK while full_page_writes are enabled

2017-10-26 Thread sanyam jain
Hi,

I was reading the blog 
https://blog.2ndquadrant.com/on-the-impact-of-full-page-writes .

My queries:

How randomness of UUID will likely to create new leaf page in btree index?
In my understanding as the size of UUID is 128 bits i.e. twice of BIGSERIAL , 
more number of pages will be required to store the same number of rows and 
hence there can be increase in WAL size due to FPW .
When compared the index size in local setup UUID index is ~2x greater in size.


Thanks,

Sanyam Jain



[HACKERS] Start logical decoding from any lsn present in the wal segment

2017-06-29 Thread sanyam jain
Hi,

Currently logical decoding finds a consistent point by generating a snapshot 
and stream changes after consistent point.I want to change this behaviour to 
something which stream changes from a lsn in the past provided its present in 
wal segment.Can this behaviour be implemented and if yes, what are the steps i 
should perform to implement the same.


Thanks,

Sanyam Jain


Re: [HACKERS] pgjdbc logical replication client throwing exception

2017-06-27 Thread sanyam jain
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 
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


Re: [HACKERS] pgjdbc logical replication client throwing exception

2017-06-26 Thread sanyam jain
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


Re: [HACKERS] Logical decoding on standby

2017-06-26 Thread sanyam jain
Hi,
>After changing
>sendTimeLineIsHistoric = state->currTLI == ThisTimeLineID;
>to
>sendTimeLineIsHistoric = state->currTLI != ThisTimeLineID;
>
>I was facing another issue.
>On promotion of a cascaded server ThisTimeLineID in the standby server having 
>>logical slot becomes 0.
>Then i added a function call to GetStandbyFlushRecPtr in 
>StartLogicalReplication >which updates ThisTimeLineID.
>
>After the above two changes timeline following is working.But i'm not sure 
>whether >this is correct or not.In any case please someone clarify.


Please anyone with experience can explain whether the steps i have done are 
correct or not.

Thanks,
Sanyam Jain


[HACKERS] pgjdbc logical replication client throwing exception

2017-06-23 Thread sanyam jain
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



Re: [HACKERS] Logical decoding on standby

2017-06-21 Thread sanyam jain
Hi,
After changing
sendTimeLineIsHistoric = state->currTLI == ThisTimeLineID;
to
sendTimeLineIsHistoric = state->currTLI != ThisTimeLineID;

I was facing another issue.
On promotion of a cascaded server ThisTimeLineID in the standby server having 
logical slot becomes 0.
Then i added a function call to GetStandbyFlushRecPtr in 
StartLogicalReplication which updates ThisTimeLineID.

After the above two changes timeline following is working.But i'm not sure 
whether this is correct or not.In any case please someone clarify.

Thanks,
Sanyam Jain


Re: [HACKERS] Logical decoding on standby

2017-06-20 Thread sanyam jain
Hi,

In this patch in walsender.c sendTimeLineIsHistoric is set to true when current 
and ThisTimeLineID are equal.

sendTimeLineIsHistoric = state->currTLI == ThisTimeLineID;


Shouldn't sendTimeLineIsHistoric is true when state->currTLI is less than 
ThisTimeLineID.


When i applied the timeline following patch alone pg_recvlogical quits in 
startup phase but when i made the above change pg_recvlogical works although 
timeline following doesn't work.


Thanks,

Sanyam Jain


From: pgsql-hackers-ow...@postgresql.org  
on behalf of Robert Haas 
Sent: Wednesday, April 5, 2017 3:25:50 PM
To: Andres Freund
Cc: Craig Ringer; Simon Riggs; Thom Brown; Michael Paquier; Petr Jelinek; 
PostgreSQL Hackers
Subject: Re: [HACKERS] Logical decoding on standby

On Wed, Apr 5, 2017 at 10:32 AM, Andres Freund  wrote:
> On 2017-04-05 17:18:24 +0800, Craig Ringer wrote:
>> On 5 April 2017 at 04:19, Andres Freund  wrote:
>> > On 2017-04-04 22:32:40 +0800, Craig Ringer wrote:
>> >> I'm much happier with this. I'm still fixing some issues in the tests
>> >> for 03 and tidying them up, but 03 should allow 01 and 02 to be
>> >> reviewed in their proper context now.
>> >
>> > To me this very clearly is too late for v10, and now should be moved to
>> > the next CF.
>>
>> I tend to agree that it's late in the piece. It's still worth cleaning
>> it up into a state ready for early pg11 though.
>
> Totally agreed.

Based on this exchange, marked as "Moved to next CF".

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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


Re: [HACKERS] Why forcing Hot_standby_feedback to be enabled when creating a logical decoding slot on standby

2017-06-15 Thread sanyam jain
Isn't XLogRecord carries full information to be decoded in itself?If so a 
VACCUM should not be a problem in decoding?

Thanks
Sanyam Jain



From: Michael Paquier 
Sent: Monday, June 12, 2017 6:52:06 AM
To: sanyam jain
Cc: Pg Hackers
Subject: Re: [HACKERS] Why forcing Hot_standby_feedback to be enabled when 
creating a logical decoding slot on standby

On Mon, Jun 12, 2017 at 3:16 PM, sanyam jain  wrote:
> I have created a logical decoding slot on a standby but i haven't enabled
> Hot_standby_feedback.What are the test cases where this setup will fail?

hot_standby_feedback needs to be enabled at all times in logical
decoding so as the node does not remove rows that are still needed for
the decoding, and a VACUUM passing by with a minimal xmin too high
would cause inconsistent decoded data.
--
Michael


[HACKERS] Why forcing Hot_standby_feedback to be enabled when creating a logical decoding slot on standby

2017-06-11 Thread sanyam jain
Hi,

I have created a logical decoding slot on a standby but i haven't enabled 
Hot_standby_feedback.What are the test cases where this setup will fail?


Thanks,

Sanyam Jain


[HACKERS] Use of snapshot in logical replication

2017-06-07 Thread sanyam jain
Hi,

Can someone explain the usage of exporting snapshot when a logical replication 
slot is created?


Thanks,

Sanyam Jain