Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-22 Thread Subhankar Chattopadhyay
Thanks John, Well that clarifies about archive a lot! On 22 Nov 2016 22:22, "John R Pierce" wrote: On 11/22/2016 3:41 AM, Subhankar Chattopadhyay wrote: > John, > > Can you explain the Wal Archive procedure, how it can be setup so that > the slave never goes out of sync, even if master deletes

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-22 Thread John R Pierce
On 11/22/2016 3:41 AM, Subhankar Chattopadhyay wrote: John, Can you explain the Wal Archive procedure, how it can be setup so that the slave never goes out of sync, even if master deletes the WAL files? The WAL archive will typically be a separate file server that both the master and slave ca

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-22 Thread John R Pierce
On 11/22/2016 2:34 AM, Subhankar Chattopadhyay wrote: So, the question here is while I apply update on Slave, how do I know if if it will be able to catch up or I need Wal archive? Is there a way I can determine this? In my case, while applying update on slave, the db process will be stopped, so

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-22 Thread Subhankar Chattopadhyay
John, Can you explain the Wal Archive procedure, how it can be setup so that the slave never goes out of sync, even if master deletes the WAL files? On Tue, Nov 22, 2016 at 4:04 PM, Subhankar Chattopadhyay wrote: > So, the question here is while I apply update on Slave, how do I know > if if it

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-22 Thread Subhankar Chattopadhyay
So, the question here is while I apply update on Slave, how do I know if if it will be able to catch up or I need Wal archive? Is there a way I can determine this? In my case, while applying update on slave, the db process will be stopped, so the query, even if it gives correct value, won't help. C

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread John R Pierce
On 11/20/2016 11:00 PM, Subhankar Chattopadhyay wrote: Yes so if the slave is behind I need to start over pgbasebackup. I saw according to the documentation this query gives us the replication state. Can somebody tell me if this would be sufficient to know if I need to start over the backup ?

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread Subhankar Chattopadhyay
Yes so if the slave is behind I need to start over pgbasebackup. I saw according to the documentation this query gives us the replication state. Can somebody tell me if this would be sufficient to know if I need to start over the backup ? On 21 Nov 2016 12:18, "John R Pierce" wrote: > On 11/20/2

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread John R Pierce
On 11/20/2016 10:37 PM, Subhankar Chattopadhyay wrote: We are using the database in a cloud setup and the nodes are running in VMs. The slave can fall behind for various reasons as you have stated, like slave is shut down or high write workload. We don't use replication slot but the wal_keep_seg

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread Subhankar Chattopadhyay
Hi John, We are using the database in a cloud setup and the nodes are running in VMs. The slave can fall behind for various reasons as you have stated, like slave is shut down or high write workload. We don't use replication slot but the wal_keep_segments is high enough for us, 5000 to be exact.

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread John R Pierce
On 11/20/2016 10:00 PM, Subhankar Chattopadhyay wrote: Thanks for reply. In situations where slave is behind master, if I don't start over, will it catch up automatically? I am using 9.4 version. it should stay within a few seconds under normal conditions. why is it falling behind, is your w

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread Subhankar Chattopadhyay
Hi John, Thanks for reply. In situations where slave is behind master, if I don't start over, will it catch up automatically? I am using 9.4 version. On Mon, Nov 21, 2016 at 11:22 AM, John R Pierce wrote: > On 11/20/2016 9:29 PM, Subhankar Chattopadhyay wrote: >> >> We have setup PostgreSQL mast

Re: [GENERAL] pg_basebackup on slave running for a long time

2016-11-20 Thread John R Pierce
On 11/20/2016 9:29 PM, Subhankar Chattopadhyay wrote: We have setup PostgreSQL master-slave topology with Streaming replication setup. One of the steps for setting up streaming replication is to do pg_basebackup on slave from master. For subsequent update of this database, this step is repeated