mirror of
https://github.com/postgres/postgres.git
synced 2025-06-03 01:21:48 +03:00
Remove EXTENSION_DONT_CHECK_SIZE from md.c.
Commits 7bb3102c and 3eb77eba removed the only user of the EXTENSION_DONT_CHECK_SIZE flag, which had previously been required to checkpoint truncated relations. Since 7bb3102c, 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
This commit is contained in:
parent
c72ca3ddec
commit
48c142f78d
@ -106,14 +106,6 @@ static MemoryContext MdCxt; /* context for all MdfdVec objects */
|
|||||||
#define EXTENSION_CREATE (1 << 2)
|
#define EXTENSION_CREATE (1 << 2)
|
||||||
/* create new segments if needed during recovery */
|
/* create new segments if needed during recovery */
|
||||||
#define EXTENSION_CREATE_RECOVERY (1 << 3)
|
#define EXTENSION_CREATE_RECOVERY (1 << 3)
|
||||||
/*
|
|
||||||
* Allow opening segments which are preceded by segments smaller than
|
|
||||||
* RELSEG_SIZE, e.g. inactive segments (see above). Note that this breaks
|
|
||||||
* mdnblocks() and related functionality henceforth - which currently is ok,
|
|
||||||
* because this is only required in the checkpointer which never uses
|
|
||||||
* mdnblocks().
|
|
||||||
*/
|
|
||||||
#define EXTENSION_DONT_CHECK_SIZE (1 << 4)
|
|
||||||
/* don't try to open a segment, if not already open */
|
/* don't try to open a segment, if not already open */
|
||||||
#define EXTENSION_DONT_OPEN (1 << 5)
|
#define EXTENSION_DONT_OPEN (1 << 5)
|
||||||
|
|
||||||
@ -1683,14 +1675,12 @@ _mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno,
|
|||||||
}
|
}
|
||||||
flags = O_CREAT;
|
flags = O_CREAT;
|
||||||
}
|
}
|
||||||
else if (!(behavior & EXTENSION_DONT_CHECK_SIZE) &&
|
else if (nblocks < ((BlockNumber) RELSEG_SIZE))
|
||||||
nblocks < ((BlockNumber) RELSEG_SIZE))
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* When not extending (or explicitly including truncated
|
* When not extending, only open the next segment if the current
|
||||||
* segments), only open the next segment if the current one is
|
* one is exactly RELSEG_SIZE. If not (this branch), either
|
||||||
* exactly RELSEG_SIZE. If not (this branch), either return NULL
|
* return NULL or fail.
|
||||||
* or fail.
|
|
||||||
*/
|
*/
|
||||||
if (behavior & EXTENSION_RETURN_NULL)
|
if (behavior & EXTENSION_RETURN_NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user