public inbox for [email protected]
help / color / mirror / Atom feedFrom: Andres Freund <[email protected]>
To: Robert Haas <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Heikki Linnakangas <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: making relfilenodes 56 bits
Date: Mon, 11 Jul 2022 16:21:57 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoacMgLv_0edhN=oWjnUvJyFjXww4Q4re4kfm+qkSBtjaQ@mail.gmail.com>
References: <CA+TgmoZfxMRfWW7X16TGWh1Q8taRtCb3hRTwWqY-4_XiQCYYKw@mail.gmail.com>
<CAFiTN-vTe79M8uDH1yprOU64MNFE+R3ODRuA+JWf27JbhY4hJw@mail.gmail.com>
<CA+TgmoZyKktnjNjpa_6wHfhNRaZfYS4Nfu--t8k5JgKkTR8paw@mail.gmail.com>
<CA+TgmoZTJsbJXoXWceQkaHdxjFz23BL=+xZiD64FgqVAQ77jPQ@mail.gmail.com>
<CAFiTN-s5ehHu2N9vuZcwg+NOENvf3v0FMXQQZq1faGjReP7mtw@mail.gmail.com>
<CA+TgmoZq5=LWDK7kHaUbmWXxcaTuw_QwafgG9dr-BaPym_U8WQ@mail.gmail.com>
<[email protected]>
<CA+TgmobwFU-D_cWAqUooUGaQrC91B5QOW79HF=n-1=ApmFh9=Q@mail.gmail.com>
<[email protected]>
<CA+TgmoacMgLv_0edhN=oWjnUvJyFjXww4Q4re4kfm+qkSBtjaQ@mail.gmail.com>
On 2022-07-11 16:11:53 -0400, Robert Haas wrote:
> On Mon, Jul 11, 2022 at 3:34 PM Andres Freund <[email protected]> wrote:
> > Seems pretty simple to do. Have write_relmapper_file() write to a .tmp file
> > first (likely adding O_TRUNC to flags), use durable_rename() to rename it into
> > place. The tempfile should probably be written out before the XLogInsert(),
> > the durable_rename() after, although I think it'd also be correct to more
> > closely approximate the current sequence.
>
> Something like this?
Yea. I've not looked carefully, but on a quick skim it looks good.
> I chose not to use durable_rename() here, because that allowed me to
> do more of the work before starting the critical section, and it's
> probably slightly more efficient this way, too. That could be changed,
> though, if you really want to stick with durable_rename().
I guess I'm not enthused in duplicating the necessary knowledge in evermore
places. We've forgotten one of the magic incantations in the past, and needing
to find all the places that need to be patched is a bit bothersome.
Perhaps we could add extract helpers out of durable_rename()?
OTOH, I don't really see what we gain by keeping things out of the critical
section? It does seem good to have the temp-file creation/truncation and write
separately, but after that I don't think it's worth much to avoid a
PANIC. What legitimate issue does it avoid?
Greetings,
Andres Freund
view thread (163+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: making relfilenodes 56 bits
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox