Re: archive falling behind

From: Strahinja Kustudić <strahinjak(at)nordeus(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "German Becker *EXTERN*" <german(dot)becker(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: archive falling behind
Date: 2013-04-26 19:22:01
Message-ID: CADKbJJVq75ezEC8S0yYTzA9BK8LiYkY+6xx08PXH_B7oE9tOxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

What does your shell script do that you need a script for archiving? The
archive command is usually a cp/scp/rsync command, you usually don't need
more than that.

Regards,
Strahinja

On Fri, Apr 26, 2013 at 3:55 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> German Becker wrote:
> > Here is the archive part of the config:
> >
> > archive_mode = on # allows archiving to be done
> > # (change requires restart)
> > archive_command = '/var/lib/postgresql/scripts/archive_copy.sh %p %f'
> # command to use to
> > archive a logfile segment
> > #archive_timeout = 0 # force a logfile segment switch after
> this
> > # number of seconds; 0 disables
>
> So the problem might be in that script.
>
> > The archive coommand makes a local copy and then it copies to the backup
> server via ssh. Both copies
> > are md5-checked and retried up to 3 times in case of failure.
>
> archive_command should not retry the operation, but rather
> return a non-zero return code.
>
> > I have seen under heavy load that some WALs are skipped, some have less
> size, some are corrupted (i,e,
> > the loop fails 3 times).
> > I'm not sure about the return value (checking it). What is the expected
> behaviour of the archiver?
> > Will it retry de archive if archive command returns differnt than 0?
> Will it retain the WAL segment
> > until it is succesfuly archived?
>
> See
> http://www.postgresql.org/docs/current/static/continuous-archiving.html#BACKUP-ARCHIVING-WAL
>
> archive_command should exit with zero only if the
> WAL segment was archived successfully.
> PostgreSQL will retry and retain the WAL segment until
> archival succeeds.
>
> Yours,
> Laurenz Albe
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message German Becker 2013-04-26 19:25:04 Re: archive falling behind
Previous Message Paul Hinze 2013-04-26 15:59:52 Re: [ADMIN] Simultaneous index creates on different schemas cause deadlock?