Re: pg_basebackup streaming issue from standby

Lists: pgsql-hackers
From: Thom Brown <thom(at)linux(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_basebackup streaming issue from standby
Date: 2012-03-08 01:36:30
Message-ID: CAA-aLv7jaHGxejGfC10JFLY3EO0qwXBHgtPC3Hcc2mFk1hgP4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

I've just tried using pg_basebackup to take a backup of a standby with
"-x stream" but it never finishes. This is what I get:

thom(at)swift:~/Development$ pg_basebackup -p 5489 -D data3 -x stream -Pv
xlog start point: 0/6000020
pg_basebackup: starting background WAL receiver
78020/78020 kB (100%), 1/1 tablespace
xlog end point: 0/6F819F8
pg_basebackup: waiting for background process to finish streaming...

pg_stat_replication on the standby looks like this:

thom(at)test=# select * from pg_stat_replication ;
-[ RECORD 1 ]----+------------------------------
pid | 29161
usesysid | 10
usename | thom
application_name | pg_basebackup
client_addr |
client_hostname |
client_port | -1
backend_start | 2012-03-08 01:33:32.799491+00
state | startup
sent_location | 0/0
write_location |
flush_location |
replay_location |
sync_priority | 0
sync_state | async
-[ RECORD 2 ]----+------------------------------
pid | 29162
usesysid | 10
usename | thom
application_name | pg_basebackup
client_addr |
client_hostname |
client_port | -1
backend_start | 2012-03-08 01:33:32.921461+00
state | streaming
sent_location | 0/6F819F8
write_location |
flush_location |
replay_location |
sync_priority | 0
sync_state | async

It gets stuck here and never finishes. This also prevents the standby
from shutting down unless pg_basebackup is terminated. I've attached
the log from the standby in case it's of any use (with
log_min_messages set to debug5).

This is using an unpatched copy of latest Git master.

--
Thom

Attachment Content-Type Size
postgresql-2012-03-08_012605.log text/x-log 18.9 KB

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup streaming issue from standby
Date: 2012-03-08 01:45:22
Message-ID: CAHGQGwGTNPVawrzHRWsioJ41ph7Odo4C52wLTFdCOn320OMw+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Mar 8, 2012 at 10:36 AM, Thom Brown <thom(at)linux(dot)com> wrote:
> I've just tried using pg_basebackup to take a backup of a standby with
> "-x stream" but it never finishes.

Thanks for the report! This is the same problem as I reported before.
We are now discussing how to fix that.
http://archives.postgresql.org/message-id/CAHGQGwFim5F61AfdLQH4PvARPr0Ace2=9QH62khYGraWY4E5TQ@mail.gmail.com

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup streaming issue from standby
Date: 2012-03-08 10:12:53
Message-ID: CABUevEwNLJL22cCJd2zVvv07P4OVJjbsrukL8TX8e0fDXj7xqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Mar 8, 2012 at 02:45, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Thu, Mar 8, 2012 at 10:36 AM, Thom Brown <thom(at)linux(dot)com> wrote:
>> I've just tried using pg_basebackup to take a backup of a standby with
>> "-x stream" but it never finishes.
>
> Thanks for the report! This is the same problem as I reported before.
> We are now discussing how to fix that.
> http://archives.postgresql.org/message-id/CAHGQGwFim5F61AfdLQH4PvARPr0Ace2=9QH62khYGraWY4E5TQ@mail.gmail.com

Yeah, it sounds like just that issue. And a good kick mmy way that I
need to get back on that thread :-)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


From: Thom Brown <thom(at)linux(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup streaming issue from standby
Date: 2012-03-08 11:06:24
Message-ID: CAA-aLv5Td-XCCgSosq-LXMSPOMiVXRxGX_g=dm_H=KqZrvejLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 8 March 2012 01:45, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Thu, Mar 8, 2012 at 10:36 AM, Thom Brown <thom(at)linux(dot)com> wrote:
>> I've just tried using pg_basebackup to take a backup of a standby with
>> "-x stream" but it never finishes.
>
> Thanks for the report! This is the same problem as I reported before.
> We are now discussing how to fix that.
> http://archives.postgresql.org/message-id/CAHGQGwFim5F61AfdLQH4PvARPr0Ace2=9QH62khYGraWY4E5TQ@mail.gmail.com

I hadn't read your previous post before, so apologies for the noise.
I did note from your post that the base backup can be finished by
generating enough data on the source, which worked for me too.

--
Thom