Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6474085

Browse files
committed
Fix comments on wal_level=minimal, CREATE TABLESPACE and CREATE DATABASE.
Commit97ddda8 removed the rmtree()behavior from XLOG_TBLSPC_CREATE, obsoleting that part of the comment.The comment's point about XLOG_DBASE_CREATE was wrong when commitfa0f466 introduced the point. (Itwould have been accurate if that commit had predated commitfbcbc5d introducing the secondcheckpoint of CREATE DATABASE.) Nothing can skip log_smgrcreate() onthe basis of wal_level=minimal, so don't comment on that.Commitc6b9204 expanded WAL skippingfrom five specific operations to relfilenodes generally, hence theCreateDatabaseUsingFileCopy() comment change.Discussion:https://postgr.es/m/20231008022204.cc@rfd.leadboat.com
1 parent03e9b95 commit6474085

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/backend/access/heap/heapam_handler.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,7 @@ heapam_relation_set_new_filelocator(Relation rel,
605605

606606
/*
607607
* If required, set up an init fork for an unlogged table so that it can
608-
* be correctly reinitialized on restart. Recovery may remove it while
609-
* replaying, for example, an XLOG_DBASE_CREATE* or XLOG_TBLSPC_CREATE
610-
* record. Therefore, logging is necessary even if wal_level=minimal.
608+
* be correctly reinitialized on restart.
611609
*/
612610
if (persistence==RELPERSISTENCE_UNLOGGED)
613611
{

‎src/backend/commands/dbcommands.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,10 @@ CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
644644
* make the XLOG entry for the benefit of PITR operations). This avoids
645645
* two nasty scenarios:
646646
*
647-
* #1: When PITR is off, we don't XLOG the contents of newly created
648-
* indexes; therefore the drop-and-recreate-whole-directory behavior of
649-
* DBASE_CREATE replay would lose such indexes.
647+
* #1: At wal_level=minimal, we don't XLOG the contents of newly created
648+
* relfilenodes; therefore the drop-and-recreate-whole-directory behavior
649+
* of DBASE_CREATE replay would lose such files created in the new
650+
* database between our commit and the next checkpoint.
650651
*
651652
* #2: Since we have to recopy the source database during DBASE_CREATE
652653
* replay, we run the risk of copying changes in it that were committed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp