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/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers