Re: pgsql: Remove the restriction that the relmap must be 512 bytes.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <rhaas@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Date: 2022-07-27T04:34:48Z
Lists: pgsql-hackers
Hi Robert, On Tue, Jul 26, 2022 at 07:10:22PM +0000, Robert Haas wrote: > Remove the restriction that the relmap must be 512 bytes. > > Instead of relying on the ability to atomically overwrite the > entire relmap file in one shot, write a new one and durably > rename it into place. Removing the struct padding and the > calculation showing why the map is exactly 512 bytes, and change > the maximum number of entries to a nearby round number. > > Patch by me, reviewed by Andres Freund and Dilip Kumar. > > Discussion: http://postgr.es/m/CA+TgmoZq5%3DLWDK7kHaUbmWXxcaTuw_QwafgG9dr-BaPym_U8WQ%40mail.gmail.com > Discussion: http://postgr.es/m/CAFiTN-ttOXLX75k_WzRo9ar=VvxFhrHi+rJxns997F+yvkm==A@mail.gmail.com The CI on Windows is blowing up here and there after something that looks to come from this commit, as of this backtrace: 00000000`007fe300 00000001`405c62dd postgres!errfinish( char * filename = 0x00000001`40bf1513 "fd.c", int lineno = 0n756, char * funcname = 0x00000001`40bf14e0 "durable_rename")+0x41b [c:\cirrus\src\backend\utils\error\elog.c @ 683] 00000000`007fe360 00000001`4081647b postgres!durable_rename( char * oldfile = 0x00000000`007fe430 "base/16384/pg_filenode.map.tmp", char * newfile = 0x00000000`007fe830 "base/16384/pg_filenode.map", int elevel = 0n21)+0x22d [c:\cirrus\src\backend\storage\file\fd.c @ 753] 00000000`007fe3b0 00000001`408166c9 postgres!write_relmap_file( struct RelMapFile * newmap = 0x00000000`007fecb0, bool write_wal = true, bool send_sinval = true, bool preserve_files = true, unsigned int dbid = 0x4000, unsigned int tsid = 0x67f, char * dbpath = 0x00000000`0090b1c0 "base/16384")+0x38b [c:\cirrus\src\backend\utils\cache\relmapper.c @ 971] Here is one of them, kicked by the CF bot, but I have seen similar crashes with some of my own things (see the txt file in crashlog, in a manual VACUUM): https://cirrus-ci.com/task/5240408958566400 Thanks, -- Michael
Commits
-
Bump catversion for commit d8cd0c6c95c0120168df93aae095df4e0682a08a.
- 5f858dd3bebd 16.0 landed
-
Fix read_relmap_file() concurrency on Windows.
- a2e97cb2b6fb 16.0 landed
-
Remove the restriction that the relmap must be 512 bytes.
- d8cd0c6c95c0 16.0 cited