Re: elog(DEBUG2 in SpinLocked section.

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, masao.fujii@oss.nttdata.com, amit.kapila16@gmail.com, pasim@vmware.com, pgsql-hackers@lists.postgresql.org
Date: 2020-06-03T05:47:48Z
Lists: pgsql-hackers
On Wed, Jun 03, 2020 at 01:27:51AM -0400, Tom Lane wrote:
> I'm inclined to think that memcpy'ing the ReplicationSlot struct
> into a local variable might be the best way, replacing all the
> piecemeal copying these stanzas are doing right now.  memcpy() of
> a fixed amount of data isn't quite straight-line code perhaps,
> but it has a well-defined runtime and zero chance of throwing an
> error, which are the two properties we should be most urgently
> concerned about.

+1.  And I guess that you are already on that?  ;)
--
Michael

Commits

  1. Fix instance of elog() called while holding a spinlock

  2. Don't call palloc() while holding a spinlock, either.

  3. Don't call elog() while holding spinlock.