Re: 001_rep_changes.pl stalls
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org
Date: 2020-04-20T07:02:15Z
Lists: pgsql-hackers
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().
Commits
-
In caught-up logical walsender, sleep only in WalSndWaitForWal().
- f246ea3b2a5e 13.0 landed
-
Revert "When WalSndCaughtUp, sleep only in WalSndWaitForWal()."
- 72a3dc321d76 13.0 landed
-
Add a wait_for_catchup() before immediate stop of a test master.
- b33ac1a65884 11.8 landed
- ab7699e86c16 10.13 landed
- 30afff385dd2 12.3 landed
- d60cfb6bf2b4 13.0 landed
-
When WalSndCaughtUp, sleep only in WalSndWaitForWal().
- 421685812290 13.0 landed