Re: Hot Standby (v9d) - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Hot Standby (v9d)
Date
Msg-id 4980C45D.3070009@enterprisedb.com
Whole thread Raw
In response to Re: Hot Standby (v9d)  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot Standby (v9d)  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Hot Standby (v9d)  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Simon Riggs wrote:
> The essential choice is "What would you like the max failover time to
> be?". Some users want one server with max 5 mins behind, some want two
> servers, one with 0 seconds behind, one with 12 hours behind

It's not quite that simple. Setting max_standby_delay=5mins means that 
you're willing to wait 5 minutes for each query to die. Which means that 
in worst case you have to stop for 5 minutes at every single vacuum 
record, and fall behind much more than 5 minutes.

You could make it more like that by tracking the timestamps in commit 
records, and/or having some sort of a moving average logic in the 
timeout, where you allow more waiting if you haven't waited for a long 
time, and kill queries more aggressively if you've had to wait a lot 
recently.

It should also be noted that the control functions allow you to connect 
to the database and manually pause/resume the replay. So you can for 
example set max_standby_delay=0 during the day, but pause the replay 
manually before starting a nightly report.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Hot Standby (v9d)
Next
From: Simon Riggs
Date:
Subject: Re: Hot Standby (v9d)