Re: Race conditions with checkpointer and shutdown - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Race conditions with checkpointer and shutdown
Date
Msg-id CA+TgmoZyTLE1WDaw105bxCTj9PnG2NvL60O60tDy9wTvj+mK1A@mail.gmail.com
Whole thread Raw
In response to Re: Race conditions with checkpointer and shutdown  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Race conditions with checkpointer and shutdown
List pgsql-hackers
On Tue, Apr 16, 2019 at 6:45 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Do we need to think harder about establishing rules for multiplexed
> use of the process latch?  I'm imagining some rule like "if you are
> not the outermost event loop of a process, you do not get to
> summarily clear MyLatch.  Make sure to leave it set after waiting,
> if there was any possibility that it was set by something other than
> the specific event you're concerned with".

Hmm, yeah.  If the latch is left set, then the outer loop will just go
through an extra and unnecessary iteration, which seems fine.  If the
latch is left clear, then the outer loop might miss a wakeup intended
for it and hang forever.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Next
From: Andres Freund
Date:
Subject: Re: Race conditions with checkpointer and shutdown