Thread: pgsql: Allow SetHintBits() to succeed if the buffer's LSN is new enough

pgsql: Allow SetHintBits() to succeed if the buffer's LSN is new enough

From
Andres Freund
Date:
Allow SetHintBits() to succeed if the buffer's LSN is new enough.

Previously we only allowed SetHintBits() to succeed if the commit LSN of
the last transaction touching the page has already been flushed to
disk. We can't generally change the LSN of the page, because we don't
necessarily have the required locks on the page. But the required LSN
interlock does not mean the commit record has to be flushed immediately,
it just requires that the commit record will be flushed before the page is
written out. Therefore if the buffer LSN is newer than the commit LSN,
the hint bit can be safely set.

In a number of scenarios (e.g. pgbench) this noticeably increases the
number of hint bits are set. But more importantly it also keeps the
success rate up when flushing WAL less frequently. That was the original
reason for commit 4de82f7d7, which has negative performance consequences
in a number of scenarios. This will allow a followup commit to reduce
the flush rate.

Discussion: 20160118163908.GW10941@awork2.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/db76b1efbbab2441428a9ef21f7ac9ba43c52482

Modified Files
--------------
src/backend/utils/time/tqual.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)


Re: pgsql: Allow SetHintBits() to succeed if the buffer's LSN is new enough

From
Andres Freund
Date:
On 2016-02-15 22:01:12 +0000, Andres Freund wrote:
> Allow SetHintBits() to succeed if the buffer's LSN is new enough.

Thanks, that works with my brand of annoying compiler...

Andres


Re: pgsql: Allow SetHintBits() to succeed if the buffer's LSN is new enough

From
Peter Geoghegan
Date:
On Mon, Feb 15, 2016 at 2:17 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2016-02-15 22:01:12 +0000, Andres Freund wrote:
>> Allow SetHintBits() to succeed if the buffer's LSN is new enough.
>
> Thanks, that works with my brand of annoying compiler...

Wrong commit message. :-)


--
Peter Geoghegan