Re: Connection slots reserved for replication

Oleksii Kliukin <alexk@hintbits.com>

From: Oleksii Kliukin <alexk@hintbits.com>
To: Alexander Kukushkin <cyberdemn@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>, magnus@hagander.net, Masahiko Sawada <sawada.mshk@gmail.com>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-12-05T14:33:44Z
Lists: pgsql-hackers
> On 30. Nov 2018, at 13:58, Alexander Kukushkin <cyberdemn@gmail.com> wrote:
> 
> attaching the new version of the patch.
> Now it simply reserves max_wal_senders slots in the ProcGlobal, what
> guarantees that only walsender process could use them.

With this patch It looks like InitProcess will trigger the generic error about 'too many clients' before the more specific error message in InitWalSenderSlot when exceeding the number of max_wal_senders.

Does excluding WAL senders from the max_connections limit and including max_wal_senders in MaxBackends also imply that we need to add max_wal_senders to the list at xlog.c: CheckRequiredParameterValues, requiring its value on the replica to be not lower than the one on the primary? 

Cheers,
Oleksii

Commits

  1. Fix description of WAL record XLOG_PARAMETER_CHANGE

  2. Move max_wal_senders out of max_connections for connection slot handling