Skip to content

Commit 48c142f

Browse files
committed
Remove EXTENSION_DONT_CHECK_SIZE from md.c.
Commits 7bb3102 and 3eb77eb removed the only user of the EXTENSION_DONT_CHECK_SIZE flag, which had previously been required to checkpoint truncated relations. Since 7bb3102, segments have been opened directly for synchronization without calling _mdfd_getseg(), so it doesn't need a mode that tolerates non-final short segments. Remove the redundant flag and associated comments. Reported-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/nyj4k7yur5t27rtygvx2i2lrlp6rqfvvhoiiwx4fznynksf2et%404hj2sp42alpe
1 parent c72ca3d commit 48c142f

File tree

1 file changed

+4
-14
lines changed
  • src/backend/storage/smgr

1 file changed

+4
-14
lines changed

src/backend/storage/smgr/md.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
106106
#define EXTENSION_CREATE (1 << 2)
107107
/* create new segments if needed during recovery */
108108
#define EXTENSION_CREATE_RECOVERY (1 << 3)
109-
/*
110-
* Allow opening segments which are preceded by segments smaller than
111-
* RELSEG_SIZE, e.g. inactive segments (see above). Note that this breaks
112-
* mdnblocks() and related functionality henceforth - which currently is ok,
113-
* because this is only required in the checkpointer which never uses
114-
* mdnblocks().
115-
*/
116-
#define EXTENSION_DONT_CHECK_SIZE (1 << 4)
117109
/* don't try to open a segment, if not already open */
118110
#define EXTENSION_DONT_OPEN (1 << 5)
119111

@@ -1683,14 +1675,12 @@ _mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno,
16831675
}
16841676
flags = O_CREAT;
16851677
}
1686-
else if (!(behavior & EXTENSION_DONT_CHECK_SIZE) &&
1687-
nblocks < ((BlockNumber) RELSEG_SIZE))
1678+
else if (nblocks < ((BlockNumber) RELSEG_SIZE))
16881679
{
16891680
/*
1690-
* When not extending (or explicitly including truncated
1691-
* segments), only open the next segment if the current one is
1692-
* exactly RELSEG_SIZE. If not (this branch), either return NULL
1693-
* or fail.
1681+
* When not extending, only open the next segment if the current
1682+
* one is exactly RELSEG_SIZE. If not (this branch), either
1683+
* return NULL or fail.
16941684
*/
16951685
if (behavior & EXTENSION_RETURN_NULL)
16961686
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy