Re: failover vs. read only queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: failover vs. read only queries
Date: 2010-06-09 20:06:53
Message-ID: 409.1276114013@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> The fact that failover current does *not* terminate existing queries and
> transactions was regarded as a feature by the audience, rather than a
> bug, when I did demos of HS/SR. Of course, they might not have been
> thinking of the delay for writes.

> If there were an easy way to make the trigger file cancel all running
> queries, apply remaining logs and come up, then I'd vote for that for
> 9.0. I think it's the more desired behavior by most users. However,
> I'm opposed to any complex solutions which might delay 9.0 release.

My feeling about it is that if you want fast failover you should not
have your failover target server configured as hot standby at all, let
alone hot standby with a long max_standby_delay. Such a slave could be
very far behind on applying WAL when the crunch comes, and no amount of
query killing will save you from that. Put your long-running standby
queries on a different slave instead.

We should consider whether we can improve the situation in 9.1, but it
is not a must-fix for 9.0; especially when the correct behavior isn't
immediately obvious.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-06-09 20:11:25 Re: No hash join across partitioned tables?
Previous Message Robert Haas 2010-06-09 19:56:58 Re: Invalid YAML output from EXPLAIN