Re: Hi- How frequently Postgres Poll for trigger file

From: Euler Taveira de Oliveira <euler(at)timbira(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: aaliya zarrin <aaliya(dot)zarrin(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hi- How frequently Postgres Poll for trigger file
Date: 2010-12-01 15:16:00
Message-ID: 4CF666B0.40909@timbira.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas escreveu:
> On 01.12.2010 13:27, aaliya zarrin wrote:
>> I want to know how frequently postgres search for trigger file to switch
>> over.
>
> In 9.0, every 100ms while streaming replication is active and connected.
> 5 seconds otherwise. In current git master branch, it's always 5 s.
>
>> Can this switch over time be reduced?
>
> Not without hacking the sources and compiling.
>
> Although, on many platforms, Linux included I believe, sending a signal
> to the startup process should wake it up from the sleep and make it
> check the trigger file immediately. "pg_ctl reload" for example should
> do it. So if ýou send a signal to the startup process immediately after
> creating the trigger file, it should take notice sooner.
>
Isn't it an ugly solution for stopping the replication immediately? At the top
of my head, I don't remember the reason for not turn the interval for pooling
trigger file into a configurable option. IMHO, high availability fits into
those cases (switchover immediately).

[poking the git history a little...]

I agree the a short polling interval is not energy efficient [1] but some
scenarios need this short interval. So if we want to stop the replication
immediately, we have two options: (i) advertise that we need to signal the
postmaster after creating a trigger file or (ii) made the pooling interval
configurable. As you said, there are platforms that a signal doesn't wake up a
process, so I suggest (ii) but I'm fine to include (i) at docs too.

Comments?

[1]
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=723d0184e2972f21db0f85feef3d35f0cb9b3298

--
Euler Taveira de Oliveira
http://www.timbira.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-12-01 15:21:50 Re: pg_execute_from_file review
Previous Message ghatpande 2010-12-01 15:15:25 Re: Proposal: First step towards Intelligent, integrateddatabase