HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Postgresql 9.3 replication: Preventing wal-files from building up, if receiver goes offline

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlreceivergoesbuildingreplicationofflinefileswalpreventingfrom

Problem

I have a streaming replication running between two servers.

I just upgraded to postgresql 9.3 from 9.2. Earlier on in my 9.2 setup, I have tried that my slave server went offline due to a network outage. This resulted in unshipped wal-log files building up and taking up space VERY fast on my master server.

Can I prevent this in an easy way in 9.3?

I have seen the new wal_sender_timeout config, but I am unsure what exactly it does?

What's the best way of preventing wal-files from building up on sender if receiver goes offline in 9.3?

Solution

Set wal_keep_segments to a low enough value that WAL will be discarded before pg_xlog fills up.

If you're also using WAL archiving with an archive_command, Pg will keep on trying until it successfully sends the WAL or runs out of space. Don't have your master copy the WAL directly to the replica; instead put it on some reliable high availability storage that the replica also has access to.

Context

StackExchange Database Administrators Q#59675, answer score: 3

Revisions (0)

No revisions yet.