Re: Strange issues with 9.2 pg_basebackup & replication

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Strange issues with 9.2 pg_basebackup & replication
Date: 2012-05-13 19:23:26
Message-ID: 4FB00A2E.8010504@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

More issues: the pg_basebackup -x stream on the cascading replica won't
complete until the xlog rotates on the master. (again, this is
Tuesday's snapshot).

Servers:
.226 == master-master, the writeable master
.227 == master-replica, a direct replica of master-master
.228 == replica-replica, a cascading replica of master-replica

1. recreated master-master, loaded it with some dummy databases.

2. created master-replica

3. took pg_basebackup -x stream of master-master on master-replica

4. edited recovery.conf and started master-replica. started normally.

5. created a table on master-master. change replicated to master-replica.

6. created replica-replica. started a pg_basebackup -x stream from
master-replica

7. pg_basebackup hung forever. output of -v:

xlog start point: 0/A000020
pg_basebackup: starting background WAL receiver

xlog end point: 0/A01C188
pg_basebackup: waiting for background process to finish streaming...

8. tried creating a table on master-master to create a write. this had
no effect (although the table did replicate to master-replica).

Here's pg_stat_replication on master-master while the basebackup is hung:

1385 | 16393 | replicator | walreceiver | ###.###.61.227 |
| 45396 | 2012-
05-13 19:05:11.972471+00 | streaming | 0/A024F50 | 0/A024F50 |
0/A024F50 | 0/A024F50
| 0 | async

Here's pg_stat_replication on master-replica while basebackup is hung:

1243 | 16393 | replicator | pg_basebackup | ###.###.61.228 |
| 49218 | 2012-
05-13 19:06:07.606378+00 | startup | 0/0 | |
|
| 0 | async
1244 | 16393 | replicator | pg_basebackup | ###.###.61.228 |
| 49219 | 2012-
05-13 19:06:07.611996+00 | streaming | 0/A024F50 | |
|
| 0 | async

9. Ran pg_xlog_switch() on the master.

10. basebackup completed on replica-replica.

11. edited recovery.conf on replica-replica and started it. works fine.

12. created a new table on master-master, changed replicated to
replica-replica.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-05-13 20:01:03 Re: Draft release notes complete
Previous Message Josh Berkus 2012-05-13 19:04:51 Strange issues with 9.2 pg_basebackup & replication