Kyle
Kyle

Reputation: 4238

Postgres Replication: Incomplete Startup Packet

I recently configured PostgreSQL 9.3 hot standby replication between a single master/slave.

I've checked my standby server again today and it looks like it is unable to complete and exit recovery mode on restart:

2014-03-25 22:36:07 UTC LOG:  entering standby mode
2014-03-25 22:36:07 UTC LOG:  incomplete startup packet
2014-03-25 22:36:07 UTC LOG:  redo starts at 7/E1091840
2014-03-25 22:36:07 UTC LOG:  consistent recovery state reached at 7/E10929C8
2014-03-25 22:36:07 UTC LOG:  record with zero length at 7/E10929C8
2014-03-25 22:36:07 UTC LOG:  started streaming WAL from primary at 7/E1000000 on timeline 1
2014-03-25 22:36:08 UTC FATAL:  the database system is starting up
2014-03-25 22:36:08 UTC FATAL:  the database system is starting up
2014-03-25 22:36:09 UTC FATAL:  the database system is starting up
... more ...
2014-03-25 22:36:13 UTC LOG:  incomplete startup packet

I've tried manually copying over WAL records from the master to the slave and I get the same errors, so I wonder if the WAL records on the master are the problem?

Upvotes: 5

Views: 14958

Answers (2)

Konstantin  Popov
Konstantin Popov

Reputation: 121

I have got the same issue with PostgreSQL 9.4

The reason was that in my system postgresql.conf and pg_hba.conf are situated in /etc/postgresql, so they didn't came to standby from master during pg_startbackup

As a result I has wal_level = hot_standby on master and default wal_level = minimal on standby. This produces the same picture in log.

My decision was to fix postgresql.conf on standby. After that standby started Ok and said it was ready to accept readonly connections.

Upvotes: 2

mullerivan
mullerivan

Reputation: 2023

i solved the same problem re doing

 psql -c "select pg_start_backup('initial_backup');"
 rsync -cva --inplace --exclude=*pg_xlog* /var/lib/postgresql/9.1/main/ slave_IP_address:/var/lib/postgresql/9.1/main/
 psql -c "select pg_stop_backup();"

here is a good tutorial !!

Upvotes: 2

Related Questions