From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove unnecessary smgrimmedsync() when creating unlogged table.
Date: Fri, 15 Sep 2023 14:53:25 +0000
Message-ID: <E1qhACD-003zTH-8J@gemulon.postgresql.org> (raw)
Remove unnecessary smgrimmedsync() when creating unlogged table.
This became safe after commit 4b4798e138. The smgrcreate() call will
now register the segment for syncing at the next checkpoint, so we
don't need to sync it here. If a checkpoint happens before the
creation is WAL-logged, the records will be replayed when starting
recovery from the checkpoint. If a checkpoint happens after the WAL
logging, the checkpoint will fsync() it.
In the passing, clarify a comment in smgrDoPendingSyncs().
Discussion: https://www.postgresql.org/message-id/6e5bbc08-cdfc-b2b3-9e23-1a914b9850a9%40iki.fi
Reviewed-by: Robert Haas
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/18724af9e83bb9123e0e1cd09751aef4ba30039e
Modified Files
--------------
src/backend/access/heap/heapam_handler.c | 10 +++-------
src/backend/catalog/storage.c | 2 +-
2 files changed, 4 insertions(+), 8 deletions(-)
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-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove unnecessary smgrimmedsync() when creating unlogged table.
In-Reply-To: <E1qhACD-003zTH-8J@gemulon.postgresql.org>
* 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