Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B70E99A4AA5 for ; Mon, 16 Jul 2012 08:53:16 -0300 (ADT) Received: from mortitx.uib.es ([130.206.31.221]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SqjrW-0007GK-IX for pgsql-general@postgresql.org; Mon, 16 Jul 2012 11:53:16 +0000 Received: from unknown (HELO [10.100.128.77]) ([10.100.128.77]) by smtp.uib.es with ESMTP/TLS/DHE-RSA-CAMELLIA256-SHA; 16 Jul 2012 13:52:59 +0200 Message-ID: <50040095.7080501@uib.cat> Date: Mon, 16 Jul 2012 13:52:53 +0200 From: Nicolau Roca User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Replication terminated by primary server Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201207/265 X-Sequence-Number: 188776 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@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@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