Re: InstallXLogFileSegment() vs concurrent WAL flush

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: thomas(dot)munro(at)gmail(dot)com
Cc: nagata(at)sraoss(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: InstallXLogFileSegment() vs concurrent WAL flush
Date: 2024-02-06 07:58:16
Message-ID: 20240206.165816.1496814607463556734.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 2 Feb 2024 14:42:46 +0100, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote in
> On Fri, Feb 2, 2024 at 12:56 PM Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp> wrote:
> > On Fri, 2 Feb 2024 11:18:18 +0100
> > Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > > One simple way to address that would be to make XLogFileInitInternal()
> > > wait for InstallXLogFileSegment() to finish. It's a little
> >
> > Or, can we make sure the rename is durable by calling fsync before
> > returning the fd, as a patch attached here?
>
> Right, yeah, that works too. I'm not sure which way is better.

I'm not sure I like issuing spurious syncs unconditionally. Therefore,
I prefer Thomas' approach in that regard. 0002 would be beneficial,
considering the case of a very large max_wal_size, and the code seems
to be the minimal required. I don't think it matters that the lock
attempts occur uselessly until the first segment installation. That
being said, we could avoid it by initializing
last_known_installed_segno properly.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2024-02-06 07:59:52 Re: Change GUC hashtable to use simplehash?
Previous Message Yugo NAGATA 2024-02-06 07:46:41 Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row