Re: Make relfile tombstone files conditional on WAL level
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Heikki Linnakangas <hlinnaka@iki.fi>, Thomas Munro <thomas.munro@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-01-06T08:13:27Z
Lists: pgsql-hackers
On Thu, Jan 6, 2022 at 1:12 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > > > > I think this idea is worth more consideration. It seems like 2^56 > > relfilenodes ought to be enough for anyone, recalling that you can > > only ever have 2^64 bytes of WAL. So if we do this, we can eliminate a > > bunch of code that is there to guard against relfilenodes being > > reused. In particular, we can remove the code that leaves a 0-length > > tombstone file around until the next checkpoint to guard against > > relfilenode reuse. > > +1 > I IMHO a few top level point for implementing this idea would be as listed here, 1) the "relfilenode" member inside the RelFileNode will be now 64 bytes and remove the "forkNum" all together from the BufferTag. So now whenever we want to use the relfilenode or fork number we can use the respective mask and fetch their values. 2) GetNewRelFileNode() will not loop for checking the file existence and retry with other relfilenode. 3) Modify mdunlinkfork() so that we immediately perform the unlink request, make sure to register_forget_request() before unlink. 4) In checkpointer, now we don't need any handling for pendingUnlinks. -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix typos in comments, code and documentation
- 33ab0a2a527e 16.0 cited
-
Increase width of RelFileNumbers from 32 bits to 56 bits.
- 05d4cbf9b6ba 16.0 landed
-
Move RelFileNumber declarations to common/relpath.h.
- 2f47715cc864 16.0 landed
-
Include RelFileLocator fields individually in BufferTag.
- 82ac34db2036 16.0 landed
-
Convert macros to static inline functions (buf_internals.h)
- 3ac88fddd92c 16.0 landed
-
Remove the restriction that the relmap must be 512 bytes.
- d8cd0c6c95c0 16.0 landed
-
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
- b0a55e43299c 16.0 landed
-
Reorder subskiplsn in pg_subscription to avoid alignment issues.
- 79b716cfb7a1 15.0 cited
-
Fix DROP {DATABASE,TABLESPACE} on Windows.
- 4eb2176318d0 15.0 cited
-
Restructure smgr API as per recent proposal. smgr no longer depends on
- 87bd95638552 8.0.0 cited