pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Bruce Momjian <bruce@momjian.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Multiple full page writes in a single checkpoint?
Date: Wed, 3 Feb 2021 17:00:19 -0800
Message-ID: <20210204010019.pyasieusrgi6cead@alap3.anarazel.de> (raw)
In-Reply-To: <20210204002125.GC11069@momjian.us>
References: <20210203230556.GB11069@momjian.us>
	<20210203232913.t3fng3evt4qucm3g@alap3.anarazel.de>
	<20210204002125.GC11069@momjian.us>

Hi,

On 2021-02-03 19:21:25 -0500, Bruce Momjian wrote:
> On Wed, Feb  3, 2021 at 03:29:13PM -0800, Andres Freund wrote:
> > Changing this is *completely* infeasible. In a lot of workloads it'd
> > cause a *massive* explosion of WAL volume. Like quadratically. You'll
> > need to find another way to generate a nonce.
>
> Do we often do multiple writes to the file system of the same page
> during a single checkpoint, particularly only-hint-bit-modified pages?
> I didn't think so.

It can easily happen. Consider ringbuffer using scans (like vacuum,
seqscan) - they'll force the buffer out to disk soon after it's been
dirtied. And often will read the same page again a short bit later. Or
just any workload that's a bit bigger than shared buffers (but data is
in the OS cache).  Subsequent scans will often have new hint bits to
set.


> Is the logical approach here to modify XLogSaveBufferForHint() so if a
> page write is not needed, to create a dummy WAL record that just
> increments the WAL location and updates the page LSN?
> (Is there a small WAL record I should reuse?)

I think an explicit record type would be better. Or a hint record
without an associated FPW.


> I can try to add a hint-bit-page-write page counter, but that might
> overflow, and then we will need a way to change the LSN anyway.

That's just a question of width...

Greetings,

Andres Freund





view thread (7+ messages)  latest in thread

Message-ID: <20210204010019.pyasieusrgi6cead@alap3.anarazel.de>
Permalink:  ../20210204010019.pyasieusrgi6cead@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20210204010019.pyasieusrgi6cead@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andres@anarazel.de, bruce@momjian.us
  Subject: Re: Multiple full page writes in a single checkpoint?
  In-Reply-To: <20210204010019.pyasieusrgi6cead@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox