Re: Problem with synchronous replication - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Problem with synchronous replication
Date
Msg-id 20191031013056.GB2530@paquier.xyz
Whole thread Raw
In response to Re: Problem with synchronous replication  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
On Wed, Oct 30, 2019 at 12:34:28PM +0900, Kyotaro Horiguchi wrote:
> If we do that strictly, other functions like
> SyncRepGetOldestSyncRecPtr need the same Assert()s. I think static
> functions don't need Assert() and caution in their comments would be
> enough.

Perhaps.  I'd rather be careful though if we meddle again with this
code in the future as it is shared across multiple places and
callers.

> SyncRepReleaseWaiters reads MyWalSnd->sync_standby_priority without
> holding SyncRepLock, which could lead to a message with wrong
> priority. I'm not sure it matters, though.

The WAL sender is the only writer of its info in shared memory, so
there is no problem to have it read data without its spin lock hold.

> Seems reasonable for holdoffs. The same assertion would be needed in
> more places but it's another issue.

Sure.

> By the way while I was looking this, I found a typo. Please find the
> attached.

Thanks, applied that one.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Taylor Vesely
Date:
Subject: Re: Zedstore - compressed in-core columnar storage
Next
From: Michael Paquier
Date:
Subject: Re: Problem with synchronous replication