|From:||Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>|
|Subject:||Re: Connection slots reserved for replication|
|Views:||Raw Message | Whole Thread | Download mbox|
Hello. Thank you for the new version.
At Thu, 1 Nov 2018 11:58:52 +0100, Alexander Kukushkin <cyberdemn(at)gmail(dot)com> wrote in <CAFh8B=kaX0uWdyZXn3xZPgRqhHrbiOWwFhWStdG0fvJ4is21iA(at)mail(dot)gmail(dot)com>
> Attached rebased version patch to the current HEAD and created commit fest entry
> On Fri, 21 Sep 2018 at 13:43, Alexander Kukushkin <cyberdemn(at)gmail(dot)com> wrote:
> > Hi,
> > On 20 September 2018 at 08:18, Kyotaro HORIGUCHI
> > <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> > >
> > > Instaed, we can iterally "reserve" connection slots for the
> > > specific use by providing ProcGlobal->walsenderFreeProcs. The
> > > slots are never stolen for other usage. Allowing additional
> > > walsenders comes after all the slots are filled to grab an
> > > available "normal" slot, it works as the same as the current
> > > behavior when walsender_reserved_connectsions = 0.
> > >
> > > What do you think about this?
> > Sounds reasonable, please see the updated patch.
MaxBackends = MaxConnections + autovacuum_max_workers + 1 +
+ max_worker_processes + replication_reserved_connections;
This means walsender doesn't comsume a connection, which is
different from the current behavior. We should reserve a part of
MaxConnections for walsenders. (in PostmasterMain,
max_wal_senders is counted as a part of MaxConnections)
+ if (am_walsender && replication_reserved_connections < max_wal_senders
+ && *procgloballist == NULL)
+ procgloballist = &ProcGlobal->freeProcs;
Currently exccesive number of walsenders are rejected in
InitWalSenderSlot and emit the following error.
> errmsg("number of requested standby connections "
> "exceeds max_wal_senders (currently %d)",
With this patch, if max_wal_senders =
replication_reserved_connections = 3 and the fourth walreceiver
comes, we will get "FATAL: sorry, too many clients already"
instead. It should be fixed.
When r_r_conn = 2 and max_wal_senders = 3 and the three
walsenders are active, in an exreme case where a new replication
connection comes at the same time another is exiting, we could
end up using two normal slots despite that one slot is vacant in
reserved slots. If we want to avoid the case, we need to limit
the number of normal slots to use. I don't think it is acceptable
as is but basically something like the attached would do that.
NTT Open Source Software Center
|Next Message||Peter Eisentraut||2018-11-06 12:27:16||Re: [HACKERS] generated columns|
|Previous Message||Etsuro Fujita||2018-11-06 12:07:37||Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT|