mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Fix comments on wal_level=minimal, CREATE TABLESPACE and CREATE DATABASE.
Commit97ddda8a82
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 commitfa0f466d53
introduced the point. (It would have been accurate if that commit had predated commitfbcbc5d06f
introducing the second checkpoint of CREATE DATABASE.) Nothing can skip log_smgrcreate() on the basis of wal_level=minimal, so don't comment on that. Commitc6b92041d3
expanded WAL skipping from five specific operations to relfilenodes generally, hence the CreateDatabaseUsingFileCopy() comment change. Discussion: https://postgr.es/m/20231008022204.cc@rfd.leadboat.com
This commit is contained in:
@ -605,9 +605,7 @@ heapam_relation_set_new_filelocator(Relation rel,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If required, set up an init fork for an unlogged table so that it can
|
* If required, set up an init fork for an unlogged table so that it can
|
||||||
* be correctly reinitialized on restart. Recovery may remove it while
|
* be correctly reinitialized on restart.
|
||||||
* replaying, for example, an XLOG_DBASE_CREATE* or XLOG_TBLSPC_CREATE
|
|
||||||
* record. Therefore, logging is necessary even if wal_level=minimal.
|
|
||||||
*/
|
*/
|
||||||
if (persistence == RELPERSISTENCE_UNLOGGED)
|
if (persistence == RELPERSISTENCE_UNLOGGED)
|
||||||
{
|
{
|
||||||
|
@ -644,9 +644,10 @@ CreateDatabaseUsingFileCopy(Oid src_dboid, Oid dst_dboid, Oid src_tsid,
|
|||||||
* make the XLOG entry for the benefit of PITR operations). This avoids
|
* make the XLOG entry for the benefit of PITR operations). This avoids
|
||||||
* two nasty scenarios:
|
* two nasty scenarios:
|
||||||
*
|
*
|
||||||
* #1: When PITR is off, we don't XLOG the contents of newly created
|
* #1: At wal_level=minimal, we don't XLOG the contents of newly created
|
||||||
* indexes; therefore the drop-and-recreate-whole-directory behavior of
|
* relfilenodes; therefore the drop-and-recreate-whole-directory behavior
|
||||||
* DBASE_CREATE replay would lose such indexes.
|
* of DBASE_CREATE replay would lose such files created in the new
|
||||||
|
* database between our commit and the next checkpoint.
|
||||||
*
|
*
|
||||||
* #2: Since we have to recopy the source database during DBASE_CREATE
|
* #2: Since we have to recopy the source database during DBASE_CREATE
|
||||||
* replay, we run the risk of copying changes in it that were committed
|
* replay, we run the risk of copying changes in it that were committed
|
||||||
|
Reference in New Issue
Block a user