Обсуждение: pg_stop_backup running for 2h10m?

Поиск
Список
Период
Сортировка

pg_stop_backup running for 2h10m?

От
François Beausoleil
Дата:
Hi,

I used omnipitr to launch a base backup, but I fumbled a couple of things, so I Ctrl+C'd *once* the console where I had
omnipitr-backup-masterrunning. omnipitr-backup-master correctly launched pg_stop_backup, but pg_stop_backup has been
activefor 2h10 minutes, as reported by pg_stat_activity. 

According to the docs, pg_stop_backup wants to archive all xlogs before returning, but xlogs aren't being added to the
backupdirectory. 

What could be preventing pg_stop_backup from returning?

Thanks!
François Beausoleil
Вложения

Re: pg_stop_backup running for 2h10m?

От
François Beausoleil
Дата:
Le 2013-04-23 à 15:08, François Beausoleil a écrit :

> I used omnipitr to launch a base backup, but I fumbled a couple of things, so I Ctrl+C'd *once* the console where I
hadomnipitr-backup-master running. omnipitr-backup-master correctly launched pg_stop_backup, but pg_stop_backup has
beenactive for 2h10 minutes, as reported by pg_stat_activity. 
>
> According to the docs, pg_stop_backup wants to archive all xlogs before returning, but xlogs aren't being added to
thebackup directory. 
>
> What could be preventing pg_stop_backup from returning?

For reference, pg_stop_backup() doesn't seem to hold much locks:

> select * from pg_locks where pid = 14301;
  locktype  | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid |
virtualtransaction|  pid  |     mode      | granted 

------------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-------+---------------+---------
 virtualxid |          |          |      |       | 32/6558    |               |         |       |          | 32/6558
       | 14301 | ExclusiveLock | t 

Bye,
François
Вложения

Re: pg_stop_backup running for 2h10m?

От
Kevin Grittner
Дата:
François Beausoleil <francois@teksol.info> wrote:

> xlogs aren't being added to the backup directory.

Any clue in the server log why that is?

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: pg_stop_backup running for 2h10m?

От
François Beausoleil
Дата:
Le 2013-04-23 à 16:25, Kevin Grittner a écrit :

> François Beausoleil <francois@teksol.info> wrote:
>
>> xlogs aren't being added to the backup directory.
>
> Any clue in the server log why that is?

I checked but didn't mention it. I ended up calling pg_cancel_backend() on the process, after 3h. strace on the process
revealedpg_stop_backup was doing stat('pg_xlog/archive_status/000###.ready'), but the file never appeared. 

As I said, I had written a bad omnipitr command, and was trying to backup to a non-existent host, which would have
failed.

I'm recovered now and the backup's going.

Bye,
François
Вложения

Re: pg_stop_backup running for 2h10m?

От
hubert depesz lubaczewski
Дата:
On Tue, Apr 23, 2013 at 03:08:52PM -0400, François Beausoleil wrote:
> I used omnipitr to launch a base backup, but I fumbled a couple of
> things, so I Ctrl+C'd *once* the console where I had
> omnipitr-backup-master running. omnipitr-backup-master correctly
> launched pg_stop_backup, but pg_stop_backup has been active for 2h10
> minutes, as reported by pg_stat_activity.

Most likely your archive_command is not doing its job. Why - hard to
tell without knowing more about the setup, but that's the direction you
should be looking in.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/


Re: pg_stop_backup running for 2h10m?

От
François Beausoleil
Дата:
Le 2013-04-24 à 09:15, hubert depesz lubaczewski a écrit :

> On Tue, Apr 23, 2013 at 03:08:52PM -0400, François Beausoleil wrote:
>> I used omnipitr to launch a base backup, but I fumbled a couple of
>> things, so I Ctrl+C'd *once* the console where I had
>> omnipitr-backup-master running. omnipitr-backup-master correctly
>> launched pg_stop_backup, but pg_stop_backup has been active for 2h10
>> minutes, as reported by pg_stat_activity.
>
> Most likely your archive_command is not doing its job. Why - hard to
> tell without knowing more about the setup, but that's the direction you
> should be looking in.

Yes, after looking at more logs, I found out I had a permission issue. I ran backup-master as root, and
omnipitr-archivewasn't able to write the the local backup directory. There should be a mention of who should run the
toolin the docs, as I was confused. 

Thanks!
François
Вложения