WAL Archive command.

From: John Britto <john(at)sodexis(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: WAL Archive command.
Date: 2017-09-25 13:05:33
Message-ID: CAExAUcUcH8HWhVdrhB6UDayYyawH5GKbpDR7y+JYiaj40Sr2wQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a streaming replication setup along with WAL archive.

archive_command = ‘test ! -f /var/pg_archive/%f && cp %p <archive
location>%f && scp %p postgres(at)192(dot)168(dot)0(dot)123:<archive location>/%f'

When the SCP command fails, the master repeatedly tries to send the
archived WAL to standby. But during this time, the pg_xlog directly grew
with newer WAL files.

The streaming replication hasn't had the problem because on my check, the
WAL write location on the primary was same with the last WAL location
received/replayed in standby.

Since the pg_xlog in the master had few newer WAL files, the master archive
is lagging to pick the current pg_xlog WAL file. When a new WAL occur in
the pg_xlog, Master picks the old WAL file to send to the standby.

How should I force the PostgreSQL to batch copy the lagging WAL files to
pg_archive and then send to standby. Can I do this manually using rsync?
I wonder how PostgreSQL knows the changes because it maintains info in
archive_status with extension as .ready and .done.

Please assist.

Thanks,
John Britto

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Denisa Cirstescu 2017-09-25 16:13:00 Catching errors inside a LOOP is causing performance issues
Previous Message Vladimir Mihailenco 2017-09-25 09:10:32 Re: shared_buffers smaller than max_wal_size