pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Move max_wal_senders out of max_connections for connection slot
Date: Tue, 12 Feb 2019 01:21:04 +0000
Message-ID: <E1gtMky-0005bu-Ji@gemulon.postgresql.org> (raw)

Move max_wal_senders out of max_connections for connection slot handling

Since its introduction, max_wal_senders is counted as part of
max_connections when it comes to define how many connection slots can be
used for replication connections with a WAL sender context.  This can
lead to confusion for some users, as it could be possible to block a
base backup or replication from happening because other backend sessions
are already taken for other purposes by an application, and
superuser-only connection slots are not a correct solution to handle
that case.

This commit makes max_wal_senders independent of max_connections for its
handling of PGPROC entries in ProcGlobal, meaning that connection slots
for WAL senders are handled using their own free queue, like autovacuum
workers and bgworkers.

One compatibility issue that this change creates is that a standby now
requires to have a value of max_wal_senders at least equal to its
primary.  So, if a standby created enforces the value of
max_wal_senders to be lower than that, then this could break failovers.
Normally this should not be an issue though, as any settings of a
standby are inherited from its primary as postgresql.conf gets normally
copied as part of a base backup, so parameters would be consistent.

Author: Alexander Kukushkin
Reviewed-by: Kyotaro Horiguchi, Petr JelĂ­nek, Masahiko Sawada, Oleksii
Kliukin
Discussion: https://postgr.es/m/CAFh8B=nBzHQeYAu0b8fjK-AF1X4+_p6GRtwG+cCgs6Vci2uRuQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ea92368cd1da1e290f9ab8efb7f60cb7598fc310

Modified Files
--------------
doc/src/sgml/config.sgml                | 34 ++++++++++++++++-----------------
doc/src/sgml/high-availability.sgml     |  5 +++++
doc/src/sgml/runtime.sgml               | 10 +++++-----
src/backend/access/rmgrdesc/xlogdesc.c  |  7 ++++---
src/backend/access/transam/xlog.c       | 10 +++++++++-
src/backend/postmaster/postmaster.c     |  8 ++++----
src/backend/replication/walsender.c     | 12 ++++--------
src/backend/storage/lmgr/proc.c         | 23 +++++++++++++++++++---
src/backend/utils/init/postinit.c       | 11 +++++------
src/backend/utils/misc/guc.c            | 23 ++++++++++++++++------
src/bin/pg_controldata/pg_controldata.c |  2 ++
src/bin/pg_resetwal/pg_resetwal.c       |  2 ++
src/include/access/xlog_internal.h      |  3 ++-
src/include/catalog/pg_control.h        |  3 ++-
src/include/storage/proc.h              |  2 ++
15 files changed, 100 insertions(+), 55 deletions(-)



Message-ID: <E1gtMky-0005bu-Ji@gemulon.postgresql.org>
Permalink:  ../E1gtMky-0005bu-Ji@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gtMky-0005bu-Ji@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Move max_wal_senders out of max_connections for connection slot
  In-Reply-To: <E1gtMky-0005bu-Ji@gemulon.postgresql.org>
  References: <E1gtMky-0005bu-Ji@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox