Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Date: 2022-03-14 11:51:32
Message-ID: CAFiTN-vMPvdTXDvnLeYuhhptfT-aWGnqwxnTSZ14wy-uTyRbKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 12, 2022 at 11:06 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> In fact while we are rewriting the relation during vacuum full that
> time also we are calling log_newpage() under RelationCopyStorage() and
> during standby if it gets promoted we will be having some buffers in
> the buffer pool with the new relfilenode. So I think our case is also
> the same.
>
> So here my stand is that we need to drop database buffers and remove
> pending sync requests because we are deleting underlying files and if
> we do not do that in some extreme cases then there is no need to drop
> the buffers or remove the pending sync request and the worst
> consequences would be waste of disk space.

So other than this open point I have fixed other comments given by you
which includes,

- Avoid copying temp relfilenode
- Rename of functions CopyDatabase* -> CreateDatabaseUsing*
- GetDatabaseRelationList and friends to ScanSourceDatabasePgClass*
- Removed unused structure and macro because we are using the same WAL
for copying the database using the old method or creating the
directory and version files for the new method. Do you think we
should introduce a new WAL for that instead of using the same?

Other than that, I have fixed some mistakes in comments and supported
tab completion for the new options.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v14-0002-Extend-relmap-interfaces.patch text/x-patch 4.1 KB
v14-0001-Refactor-relmap-load-and-relmap-write-functions.patch text/x-patch 10.9 KB
v14-0004-New-interface-to-lock-relation-id.patch text/x-patch 2.2 KB
v14-0003-Allow-ReadBufferWithoutRelcache-to-support-unlog.patch text/x-patch 4.2 KB
v14-0005-WAL-logged-CREATE-DATABASE.patch text/x-patch 38.6 KB
v14-0006-Support-create-database-strategy-in-createdb-too.patch text/x-patch 5.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2022-03-14 11:53:24 RE: Optionally automatically disable logical replication subscriptions on error
Previous Message Julien Rouhaud 2022-03-14 11:45:55 Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)