Strange issues with 9.2 pg_basebackup & replication

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Strange issues with 9.2 pg_basebackup & replication
Date: 2012-05-13 19:04:51
Message-ID: 4FB005D3.1090802@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Doing some beta testing, managed to produce this issue using the daily
snapshot from Tuesday:

1. Created master server, loaded it with a couple dummy databases.

2. Created standby server.

3. Did pg_basebackup -x stream on standby server

4. Started standby server.

5. Realized I'd forgotten to create a recovery.conf. Shut down the
standby server, wrote a recovery.conf, and restarted it.

6. Standby server looked normal and appeared to be replicating. Master
server showed it as replicating:

postgres=# select * from pg_stat_replication;
pid | usesysid | usename | application_name | client_addr |
client_hostname | client_port |
backend_start | state | sent_location | write_location |
flush_location | replay_location
| sync_priority | sync_state
------+----------+------------+------------------+----------------+-----------------+-------------+------
-------------------------+-----------+---------------+----------------+----------------+-----------------
+---------------+------------
1278 | 16393 | replicator | walreceiver | ###.###.61.227 |
| 45391 | 2012-
05-13 18:44:18.603122+00 | streaming | 0/70000B8 | 0/70000B8 |
0/70000B8 | 0/70000E0
| 0 | async

7. Did a "create table" on the master server, creating an empty table.

8. Got this fatal error on the standby server:

LOG: record with incorrect prev-link 0/70000B8 at 0/70000E0
LOG: record with incorrect prev-link 0/70000B8 at 0/70000E0

... this error message repeated every 5s.

Either the swap of the standby into proper standby mode should have been
OK (since there were no writes on the master or the standby in that
time), or it should have failed immediately. Clearly there's something
broken here.

Note that I more-or-less did the same test on 9.1, and it didn't break
in this way.

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2012-05-13 19:23:26 Re: Strange issues with 9.2 pg_basebackup & replication
Previous Message Peter Geoghegan 2012-05-13 19:03:36 Re: Foreign keys in pgbench