Re: Removing max_connection requirement on hot_standby - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Removing max_connection requirement on hot_standby
Date
Msg-id 560C0F86.7060104@iki.fi
Whole thread Raw
In response to Removing max_connection requirement on hot_standby  (Chris Winslett <chris@compose.io>)
Responses Re: Removing max_connection requirement on hot_standby  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 09/30/2015 04:31 AM, Chris Winslett wrote:
> I'm orchestrating Postgres to behave as a leader-follower cluster. I've run
> into issues when I am scaling down a connection count for a cluster
> (scaling up is fine -- scaling down results in fatal errors).  I use an
> open source tool I've written to orchestrate the cluster called Governor (
> http://github.com/compose/governor).  It would work if I weren't running
> hot_standby, but alas…I'm running with it.
>
> I found the code which throws the fatal is actually a pre-flight test for
> hot_standby written in 2009 (i.e. battle tested):
>
>
https://github.com/postgres/postgres/blob/efc16ea520679d713d98a2c7bf1453c4ff7b91ec/src/backend/access/transam/xlog.c#L5312-L5321
>
> I've tested changing this value from a FATAL to a WARN.  I've compiled and
> tested my scenario and all appears to be correct:
>
> https://github.com/compose/postgres/commit/2bdf6b36821987aadb401e1b8590ecc5b02126d8

It will work, until you actually have more active transactions in the 
master than you have slots available in the standby.

- Heikki




pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: No Issue Tracker - Say it Ain't So!
Next
From: Andres Freund
Date:
Subject: Re: Removing max_connection requirement on hot_standby