Re: Latch for the WAL writer - further reducing idle wake-ups. - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Latch for the WAL writer - further reducing idle wake-ups.
Date
Msg-id CAEYLb_XggnfVNWUYv6wvTM5K43YdwsqjN66H4vCUB7FHkQoo=A@mail.gmail.com
Whole thread Raw
In response to Re: Latch for the WAL writer - further reducing idle wake-ups.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Latch for the WAL writer - further reducing idle wake-ups.
Re: Latch for the WAL writer - further reducing idle wake-ups.
List pgsql-hackers
On 8 May 2012 22:35, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Now that I've actually read the patch, rather than just responding to
> your description of it, I find myself entirely unhappy with the proposed
> changes in the walwriter's sleep logic.  You have introduced race
> conditions (it is NOT okay to reset the latch somewhere below the top of
> the loop)

Yes, there is some checking of flags before the potential ResetLatch()
call, which may be acted on. The code there is almost identical to
that of the extant bgwriter code. I was under the impression that this
did not amount to a race, though it's rather late now, and I'm feeling
under the weather, so I have not taken steps to verify that I have it
right. Arguably, you'd want somebody's SetLatch call to be ignored if

> and degraded the walwriter's signal response time in normal
> non-hibernation state, to solve a problem not in evidence; to wit that
> backends spend too much time signaling the walwriter.  Given the
> location of the only existing SetLatch call for the purpose, I find that
> proposition more than a bit doubtful.

I do too. The elaborate logic to reduce that overhead was nothing more
than a vestige of the first version. I apologise for making such a
basic error.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Latch for the WAL writer - further reducing idle wake-ups.
Next
From: Tom Lane
Date:
Subject: Re: Latch for the WAL writer - further reducing idle wake-ups.