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

From Tom Lane
Subject Re: Latch for the WAL writer - further reducing idle wake-ups.
Date
Msg-id 5895.1336530022@sss.pgh.pa.us
Whole thread Raw
In response to Re: Latch for the WAL writer - further reducing idle wake-ups.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On further reflection I've realized that there's a really unpleasant
consequence of the walwriter change as-committed: it breaks the former
guarantee that async commits would reach disk within at most 3 times
the WalWriterDelay setting.  They will still get written within at most
3 walwriter cycles, but a lone async commit occurring when the writer
is hibernating could see a delay much longer than before.  This seems to
me to be unacceptable.  Probably nobody cares that much about the exact
multiplier of 3, but if the delay could be an order of magnitude or two
more than that, that's going to make users of async commits unhappy.

So what we need here is for XLogSetAsyncXactLSN() to be able to boot the
walwriter out of hibernate mode.  I still don't care in the least for
the original hack of using the state of the procLatch to indicate
whether the walwriter is hibernating, but we can add a separate flag
instead so as to avoid having every trip through XLogSetAsyncXactLSN
do a SetLatch call (which would be bad anyway since it would prevent
the walwriter from sleeping normally).  Since XLogSetAsyncXactLSN
has to take the info_lck anyway, we might as well make this new flag
be protected by info_lck.  The walwriter won't need to change the
flag's state very often, by definition, so that end of it isn't going
to cost anything noticeable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Re: WIP Patch: Selective binary conversion of CSV file foreign tables
Next
From: Aidan Van Dyk
Date:
Subject: Re: synchronous_commit and remote_write