pg_archivecleanup with multiple slaves

Поиск
Список
Период
Сортировка
От Ben Lancaster
Тема pg_archivecleanup with multiple slaves
Дата
Msg-id D1FBF69C-F380-4F16-AF57-20A32CB4850C@holler.co.uk
обсуждение исходный текст
Ответы Re: pg_archivecleanup with multiple slaves
Re: pg_archivecleanup with multiple slaves
Список pgsql-admin
Hi,

First post, forgive me if this is better suited to pgsql-general.

I've got streaming replication set up with two slave servers (PostgreSQL 9.0 on Ubuntu 10.04 LTS). The master pushes
theWAL to an NFS export, which is in turn mounted on and picked up by the two slaves. 

The problem I have is that pg_archivecleanup (running on one of the slaves) was removing WAL logs before the other
slavehad picked up the changes, thus breaking replication for the second slave. As an interim fix, I simply disabled
theautomatic cleanup and figured I'd worry about it later. 

Well, later is now and I'm running out of HDD space. So, what's the best (or perhaps, correct) way to handle cleaning
upWAL archives when there's more than one slave? My first thought was prefixing the pg_archivecleanup call in
recovery.conf'sarchive_cleanup_command with a "sleep" of a few seconds to allow both slaves to pick up changes before
WALfiles are cleaned up, but I'm afraid I'll end up with some weird race conditions, with loads of sleeping processes
waitingto cleanup WAL files that have previously been cleaned up by a recently awoken process. 

Thanks in advance,

Ben


В списке pgsql-admin по дате отправления:

Предыдущее
От: Alan Gutierrez
Дата:
Сообщение:
Следующее
От: Tim
Дата:
Сообщение: Re: pg_archivecleanup with multiple slaves