Re: Slave promotion failure

From: François Beausoleil <francois(at)teksol(dot)info>
To: François Beausoleil <francois(at)teksol(dot)info>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Forums postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Slave promotion failure
Date: 2013-06-07 19:16:58
Message-ID: 1890B8C5-E8A3-4A1A-BC6B-86C8BF71C505@teksol.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Le 2013-06-07 à 12:00, François Beausoleil a écrit :

>
> Le 2013-06-07 à 07:00, François Beausoleil a écrit :
>
>>
>> Le 2013-06-06 à 18:40, Michael Paquier a écrit :
>>
>>> On Fri, Jun 7, 2013 at 1:37 AM, François Beausoleil <francois(at)teksol(dot)info> wrote:
>>> I can't seem to promote the slave:
>>>
>>> $ sudo -u postgres touch /var/lib/postgresql/9.1/main/recovery.done
>>> # log is silent
>>> This has no effect. recovery.conf is renamed to recovery.done internally by the server. If recovery.done is present in data folder with recovery.conf at the moment of promotion, recovery.done is removed before file renaming. What you can do to use a trigger file for promotion is setting up trigger_file in recovery.conf, then promotion will be kicked once file has been created.
>>
>> I believe I know what my mistake is: I set trigger_file to /var/lib/postgresql/9.1/main/recovery.done -- and PostgreSQL doesn't seem to like that name. I should set to another name and retry.
>>
>> It's still strange that pg_ctl promote didn't work though. Maybe because recovery.done existed at the time I tried.
>>
>> I'll try again today, with better names.
>
> Okay, here's my new recovery.conf:
>
> standby_mode = on
> restore_command = '/usr/local/omnipitr/bin/omnipitr-restore -D /var/lib/postgresql/9.1/main/ --source gzip=/var/backups/seevibes/wal/dbanalytics.production/ --remove-unneeded --temp-dir /var/tmp/omnipitr -l /var/log/omnipitr/restore.log --error-pgcontroldata hang --pgcontroldata-path /usr/lib/postgresql/9.1/bin/pg_controldata "%f" "%p"'
> trigger_file = '/var/lib/postgresql/9.1/main/trigger-promotion'
> archive_cleanup_command = '/usr/local/omnipitr/bin/omnipitr-cleanup --log /var/log/omnipitr/cleanup.log --archive gzip=/var/backups/seevibes/wal/dbanalytics.production "%r"'
>
> Notice trigger_file has a better name. I touch the file using:
>
> sudo -u postgres touch /var/lib/postgresql/9.1/main/trigger-promotion
>
> and nothing happens: no messages appear in the log, PostgreSQL continues to apply WAL records.
>
> I've just retried pg_ctl promote, and that too didn't do anything. I'm really at a loss to explain what happens.

I answered my question. I use OmniPITR, and I forgot to include the --finish-recovery flag, pointing to the trigger file.

Bye,
François

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-06-07 19:59:15 Re: PostgreSQL Synchronous Replication in production
Previous Message Jorge Arévalo 2013-06-07 18:18:22 Re: What's a good way to improve this query?