Re: background processes vs. hot standby - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: background processes vs. hot standby
Date
Msg-id 20130524152529.GJ15045@eldon.alvh.no-ip.org
Whole thread Raw
In response to Re: background processes vs. hot standby  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: background processes vs. hot standby  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Andres Freund escribió:

> I wonder if we shouldn't make background workers use connections slots
> from max_connections similar to how superuser_reserved_connections
> work. That would mean we don't need to care about it for HS.

I remember considering this and concluding that it's messy.  Suppose we
decide that the registered bgworker number would be subtracted from
max_connections: if the configuration registers as many bgworkers as
max_connections, then no client connections can take place; if there are
more bgworkers than max_connections, there's going to be errors at
startup because the last few bgworkers cannot start at all (and no
client connections will be allowed).  So users would be forced to change
max_connections according to bgworkers configuration.  That doesn't
sound friendly.

If, instead of subtracting bgworkers from max_connections, we were to
add the number of bgworkers to max_connections, then we're no better
than currently, because the number of bgworkers from the standby would
be different from those in the master, and we'd be back into the problem
of how to ensure that the allowed number of locks meets the restriction.
If you wanted to have more bgworkers in the master than the standby,
you'd have to advise users to increase max_connections in the standby to
fulfill the restriction.

(I currently have no proposal on how to go about solving this problem.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: pg_rewind, a tool for resynchronizing an old master after failover
Next
From: German Becker
Date:
Subject: Re: WAL segments (names) not in a sequence