pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: 001_rep_changes.pl stalls
Date: Mon, 20 Apr 2020 00:02:15 -0700
Message-ID: <20200420070215.GA1395671@rfd.leadboat.com> (raw)
In-Reply-To: <dcdb33ba-4bcc-d41e-4aad-23207e195ccf@oss.nttdata.com>
References: <20200406063649.GA3738151@rfd.leadboat.com>
	<20200414013849.GA886648@rfd.leadboat.com>
	<8807.1586828716@sss.pgh.pa.us>
	<20200417054146.GA1061007@rfd.leadboat.com>
	<fba5fc85-205a-3aeb-9bf6-a124f762aa27@oss.nttdata.com>
	<20200418070142.GA1075445@rfd.leadboat.com>
	<dcdb33ba-4bcc-d41e-4aad-23207e195ccf@oss.nttdata.com>

On Mon, Apr 20, 2020 at 02:30:08PM +0900, Fujii Masao wrote:
> +		 * Block if we have unsent data.  XXX For logical replication, let
> +		 * WalSndWaitForWal(), handle any other blocking; idle receivers need
> +		 * its additional actions.  For physical replication, also block if
> +		 * caught up; its send_data does not block.
> 
> It might be better to s/WalSndWaitForWal()/send_data()? Because not only
> WalSndWaitForWal() but also WalSndWriteData() seems to handle the blocking.
> WalSndWriteData() is called also under send_data, i.e., XLogSendLogical().

Thanks for reviewing.  WalSndWriteData() blocks when we have unsent data,
which is the same cause for blocking in WalSndLoop().  Since the comment you
quote says we let WalSndWaitForWal() "handle any other blocking", I don't
think your proposed change makes it more correct.  Also, if someone wants to
refactor this, the place to look is WalSndWaitForWal(), not any other part of
send_data().





view thread (17+ messages)  latest in thread

Message-ID: <20200420070215.GA1395671@rfd.leadboat.com>
Permalink:  ../20200420070215.GA1395671@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20200420070215.GA1395671@rfd.leadboat.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, masao.fujii@oss.nttdata.com, horikyota.ntt@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: 001_rep_changes.pl stalls
  In-Reply-To: <20200420070215.GA1395671@rfd.leadboat.com>

* 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