pgsql: Fix bugs in mdsyncfiletag().

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix bugs in mdsyncfiletag().
Date: 2019-04-05 04:50:00
Message-ID: E1hCGng-0003IO-7I@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix bugs in mdsyncfiletag().

Commit 3eb77eba moved a _mdfd_getseg() call from mdsync() into a new
callback function mdsyncfiletag(), but didn't get the arguments quite
right. Without the EXTENSION_DONT_CHECK_SIZE flag we fail to open a
segment if lower-numbered segments have been truncated, and it wants
a block number rather than a segment number.

While comparing with the older coding, also remove an unnecessary
clobbering of errno, and adjust the code in mdunlinkfiletag() to
ressemble the original code from mdpostckpt() more closely instead
of using an unnecessary call to smgropen().

Author: Thomas Munro
Discussion: https://postgr.es/m/CA%2BhUKGL%2BYLUOA0eYiBXBfwW%2BbH5kFgh94%3DgQH0jHEJ-t5Y91wQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/794c543b1736f71ff5bc5231eee41cdf460ad8ce

Modified Files
--------------
src/backend/storage/smgr/md.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2019-04-05 07:01:53 pgsql: Revert "Consistently test for in-use shared memory."
Previous Message Stephen Frost 2019-04-05 02:54:35 pgsql: Handle errors during GSSAPI startup better