Thread: pg_stop_backup fails to complete

pg_stop_backup fails to complete

From
"Birchall, Austen"
Date:

I trying to do a backup on my test database however I get

testrec=# select pg_stop_backup();
WARNING:  pg_stop_backup still waiting for archive to complete (60 seconds elapsed)
WARNING:  pg_stop_backup still waiting for archive to complete (120 seconds elapsed)

Etc.

If I do a ctrl-C I then get

testrec=# select pg_stop_backup();
ERROR:  a backup is not in progress
testrec=#

I tried doing a  select pg_switch_xlog(); before/during and after the backup but this didn't help

I've seen this error in the lists but I am still unsure what's going on.

Can anybody explain what's happening and how to 'fix' it?

Thanks

Austen

Austen Birchall  Senior Database Administrator
Met Office
FitzRoy Road Exeter EX1 3PB United Kingdom
Tel: +44 (0)1392 884481 Fax: +44 (0)1392 885681
E-mail: austen.birchall@metoffice.gov.uk Website:
http://www.metoffice.gov.uk

Re: pg_stop_backup fails to complete

From
Simon Riggs
Date:
On Mon, May 23, 2011 at 11:56 AM, Birchall, Austen
<austen.birchall@metoffice.gov.uk> wrote:
> I trying to do a backup on my test database however I get
>
> testrec=# select pg_stop_backup();
> WARNING:  pg_stop_backup still waiting for archive to complete (60 seconds
> elapsed)
> WARNING:  pg_stop_backup still waiting for archive to complete (120 seconds
> elapsed)

This means your archive_command has not successfully executed.

Read the server log and find out why, then fix.

Please include the version in use when reporting possible problems. Thanks.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: pg_stop_backup fails to complete

From
"Birchall, Austen"
Date:
Hi again

after Simon pointed me in the direction of the logs I found out out that I had made an error in my  archive_command in
postgres.conf- it was trying to write to a directory that doesn't exist. 

2 further questions:

1. Is there a naming convention for the directory that holds archived WAL logs?

2. Again by convention Should the directory that holds archived WAL logs be below or above the postgres PGDATA directoy
suchas 


/var/lib/pgsql/data/wal_logs

Or


/var/lib/pgsql/wal_logs

Or is this a matter of preference? If they are to be above I presume that archive WAL logs need to be backuped
seperatelyto the database backup so that they could be used in a PITR after a total system loss? 

I'm on 8.4.5

Thanks

Austen







Austen Birchall  Senior Database Administrator
Met Office FitzRoy Road Exeter EX1 3PB United Kingdom
Tel: +44 (0)1392 884481 Fax: +44 (0)1392 885681
E-mail: austen.birchall@metoffice.gov.uk Website: http://www.metoffice.gov.uk


-----Original Message-----
From: Simon Riggs [mailto:simon@2ndQuadrant.com]
Sent: 23 May 2011 12:56
To: Birchall, Austen
Cc: pgsql-novice
Subject: Re: [NOVICE] pg_stop_backup fails to complete

On Mon, May 23, 2011 at 11:56 AM, Birchall, Austen <austen.birchall@metoffice.gov.uk> wrote:
> I trying to do a backup on my test database however I get
>
> testrec=# select pg_stop_backup();
> WARNING:  pg_stop_backup still waiting for archive to complete (60
> seconds
> elapsed)
> WARNING:  pg_stop_backup still waiting for archive to complete (120
> seconds
> elapsed)

This means your archive_command has not successfully executed.

Read the server log and find out why, then fix.

Please include the version in use when reporting possible problems. Thanks.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services