public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Dilip Kumar <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Ryo Matsumura (Fujitsu) <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy
Date: Thu, 16 Feb 2023 14:26:55 +0900
Message-ID: <Y+2+n4FuE6K5/[email protected]> (raw)
In-Reply-To: <CAFiTN-tEAaq6csi_6TB8sz=5ZV=XjhneUB0x5icfK8b3TLn+Xw@mail.gmail.com>
References: <TYCPR01MB6868677E499C9AD5123084B5E8A39@TYCPR01MB6868.jpnprd01.prod.outlook.com>
	<20230216000659.GA1932550@nathanxps13>
	<CAFiTN-tEAaq6csi_6TB8sz=5ZV=XjhneUB0x5icfK8b3TLn+Xw@mail.gmail.com>

On Thu, Feb 16, 2023 at 10:24:13AM +0530, Dilip Kumar wrote:
> Yes, there is no reason to pass this as false, seems like this is
> passed false by mistake.  And your patch fixes the issue.

So, if I am understanding this stuff right, this issue can create data
corruption once a DDL updates any pages of pg_class stored in a
template database that gets copied by this routine.  In this case, the
patch sent makes sure that any page copied will get written once a
checkpoint kicks in.  Shouldn't we have at least a regression test for
such a scenario?  The issue can happen when updating a template
database after creating a database from it, which is less worrying
than the initial impression I got, still I'd like to think that we
should have some coverage as of the special logic this code path
relies on for pg_class when reading its buffers.

I have not given much attention to this area, but I am a bit
suspicious that enforcing the default as WAL_LOG was a good idea for
15~, TBH.  We are usually much more conservative when it comes to
such choices, switching to the new behavior after a few years would
have been wiser..
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../Y+2+n4FuE6K5%[email protected]/2-signature.asc)
  download

view thread (16+ 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: DDL result is lost by CREATE DATABASE with WAL_LOG strategy
  In-Reply-To: <Y+2+n4FuE6K5/[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