Re: failover vs. read only queries

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: failover vs. read only queries
Date: 2010-06-09 09:49:19
Message-ID: AANLkTikhQI9o3wmsloS00i0FiM2zJ4NIxz1BvwQGVEbT@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 9, 2010 at 6:13 PM, Takahiro Itagaki
<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
>> To fix the problem, when the trigger file is found, I think
>> that we should cancel all the running read only queries
>> immediately (or forcibly use -1 as the max_standby_delay
>> since that point) and make the recovery go ahead.
>
> Hmmm, does the following sequence work as your expect instead of the chanage?
> It requires text-file manipulation in 1, but seems to be more flexible.
>
>  1. Reset max_standby_delay = 0 in postgresql.conf
>  2. pg_ctl reload
>  3. Create a trigger file

As far as I read the HS code, SIGHUP is not checked while a recovery
is waiting for queries :( So pg_ctl reload would have no effect on
the conflicting queries.

Independently from the problem I raised, I think that we should call
HandleStartupProcInterrupts() in that sleep loop.

> BTW, I hope we will have "pg_ctl failover --timeout=N" in 9.1
> instead of the trigger file based management.

Please feel free to try that ;)

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Fowler 2010-06-09 10:32:31 Adding XMLEXISTS to the grammar
Previous Message Fujii Masao 2010-06-09 09:31:18 Re: failover vs. read only queries