Re: making relfilenodes 56 bits
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Andres Freund <andres@anarazel.de>, Heikki Linnakangas <hlinnaka@iki.fi>, Thomas Munro <thomas.munro@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-09-09T10:02:17Z
Lists: pgsql-hackers
Attachments
- v17-0001-Widen-relfilenumber-from-32-bits-to-56-bits.patch (text/x-patch) patch v17-0001
On Thu, Sep 8, 2022 at 4:10 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > On a separate note, while reviewing the latest patch I see there is some risk of using the unflushed relfilenumber in GetNewRelFileNumber() function. Basically, in the current code, the flushing logic is tightly coupled with the logging new relfilenumber logic and that might not work with all the values of the VAR_RELNUMBER_NEW_XLOG_THRESHOLD. So the idea is we need to keep the flushing logic separate from the logging, I am working on the idea and I will post the patch soon. I have fixed the issue, so now we will track nextRelFileNumber, loggedRelFileNumber and flushedRelFileNumber. So whenever nextRelFileNumber is just VAR_RELNUMBER_NEW_XLOG_THRESHOLD behind the loggedRelFileNumber we will log VAR_RELNUMBER_PER_XLOG more relfilenumbers. And whenever nextRelFileNumber reaches the flushedRelFileNumber then we will do XlogFlush for WAL upto the last loggedRelFileNumber. Ideally flushedRelFileNumber should always be VAR_RELNUMBER_PER_XLOG number behind the loggedRelFileNumber so we can avoid tracking the flushedRelFileNumber. But I feel keeping track of the flushedRelFileNumber looks cleaner and easier to understand. For more details refer to the code in GetNewRelFileNumber(). -- 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