unnecessary creation of FSM files during bootstrap mode - Mailing list pgsql-hackers

From Amit Kapila
Subject unnecessary creation of FSM files during bootstrap mode
Date
Msg-id CAA4eK1KsET6sotf+rzOTQfb83pzVEzVhbQi1nxGFYVstVWXUGw@mail.gmail.com
Whole thread Raw
Responses Re: unnecessary creation of FSM files during bootstrap mode
List pgsql-hackers
As pointed out by John Naylor [1], it seems during bootstrap mode, we
are always creating FSM files which are not required.  In commit's
b9d01fe288 and 3908473c80, we have added some code where we allowed
the creation of files during mdopen even if they didn't exist during
the bootstrap mode.  The comments in the code say: "During bootstrap,
there are cases where a system relation will be accessed (by internal
backend processes) before the bootstrap script nominally creates it."
I am sure this will be the case when that code is added but is it
required today?  While going through commit 3908473c80, I came across
below comment:

- * During bootstrap processing, we skip that check, because pg_time,
- * pg_variable, and pg_log get created before their .bki file entries
- * are processed.
- */
+ fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, 0600);

The system tables mentioned in above commit are not present today, so
do we really need that code and even if it is required shall we do it
only for 'main' or 'init' forks?

Tom, as you are a committer of the commits b9d01fe288 and 3908473c80,
do you remember anything in this regard?


[1] - https://www.postgresql.org/message-id/CAJVSVGVtf%2B-2sQGVyEZJQh15dpVicpFA6BBiPLugaD4oBEaiHg%40mail.gmail.com

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: removal of dangling temp tables
Next
From: Amit Kapila
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables