Replication terminated by primary server

From: Nicolau Roca <nicolau(dot)roca(at)uib(dot)cat>
To: pgsql-general(at)postgresql(dot)org
Subject: Replication terminated by primary server
Date: 2012-07-16 11:52:53
Message-ID: 50040095.7080501@uib.cat
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
we have configured a synchronous master-slave replication.
Node "postgres1" is the master, while node "postgres2" is the slave.

It works fine, but when restarting the master (using "pg_ctl restart"),
the replication is broken. In the slave log we have the following message:

2012-07-16 13:10:20 CESTFATAL: replication terminated by primary server

There is a process in the slave which indicates the file the slave is
waiting for:

[postgres(at)postgres2 walpostgres1]$ ps -ef | grep start
postgres 1874 1872 0 Jun19 ? 00:01:04 postgres: startup
process waiting for 000000010000000C000000A6

Once we manually copy this file from the master (in path
$PGDATA/pg_xlog) to the archive location (in the slave), the replication
is resumed.

[postgres(at)postgres1 pg_xlog]$ scp 000000010000000C000000A6
postgres2:/home/postgres/walpostgres1
000000010000000C000000A6 100% 16MB 16.0MB/s 00:01

And in the slave log:
2012-07-16 13:16:03 CESTLOG: restored log file
"000000010000000C000000A6" from archive
2012-07-16 13:16:03 CESTLOG: record with zero length at C/A60000B0
2012-07-16 13:16:03 CESTLOG: unexpected pageaddr C/84000000 in log file
12, segment 166, offset 0
2012-07-16 13:16:03 CESTLOG: streaming replication successfully
connected to primary

Is this a configuration issue?

The archive_command in postgresql.conf in the master is:
archive_command = 'scp %p postgres2:/home/postgres/walpostgres1/%f'

Thank you
Best regards,
Nicolau

Browse pgsql-general by date

  From Date Subject
Next Message Olga Vingurt 2012-07-16 12:14:52 DB fails to start: "Could not read from file "pg_clog/0003" at offset 212992: No error.
Previous Message Alban Hertroys 2012-07-16 11:41:39 Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)