Re: pg_basebackup on slave running for a long time

From: John R Pierce <pierce(at)hogranch(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_basebackup on slave running for a long time
Date: 2016-11-21 06:12:49
Message-ID: 9786f69b-1cb5-b5cc-6e5e-fcf22024e735@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 write workload too high for the speed of the
connection between the hosts? or is the slave shut down for some
period of time?

If the slave is intermittently offline, and if you're using replication
slots (that was a new feature in 9.4), then the master will hold a queue
of pending data as long as is needed until the slave catches up again.

Alternately, you can increase wal_keep_segments for a long enough
interval to cover the worst case time the slave is offline, or you can
implement a wal archive that the slave can recover from when resuming
streaming replication.

See https://www.postgresql.org/docs/9.4/static/warm-standby.html for
discussions of these various options.

--
john r pierce, recycling bits in santa cruz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Subhankar Chattopadhyay 2016-11-21 06:37:08 Re: pg_basebackup on slave running for a long time
Previous Message Subhankar Chattopadhyay 2016-11-21 06:00:36 Re: pg_basebackup on slave running for a long time