Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit48c142f

Browse files
committed
Remove EXTENSION_DONT_CHECK_SIZE from md.c.
Commits7bb3102 and3eb77eb removed the only user of theEXTENSION_DONT_CHECK_SIZE flag, which had previously been required tocheckpoint truncated relations. Since7bb3102, segments have beenopened directly for synchronization without calling _mdfd_getseg(), soit doesn't need a mode that tolerates non-final short segments. Removethe redundant flag and associated comments.Reported-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/nyj4k7yur5t27rtygvx2i2lrlp6rqfvvhoiiwx4fznynksf2et%404hj2sp42alpe
1 parentc72ca3d commit48c142f

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
#defineEXTENSION_CREATE(1 << 2)
107107
/* create new segments if needed during recovery */
108108
#defineEXTENSION_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-
#defineEXTENSION_DONT_CHECK_SIZE(1 << 4)
117109
/* don't try to open a segment, if not already open */
118110
#defineEXTENSION_DONT_OPEN(1 << 5)
119111

@@ -1683,14 +1675,12 @@ _mdfd_getseg(SMgrRelation reln, ForkNumber forknum, BlockNumber blkno,
16831675
}
16841676
flags=O_CREAT;
16851677
}
1686-
elseif (!(behavior&EXTENSION_DONT_CHECK_SIZE)&&
1687-
nblocks< ((BlockNumber)RELSEG_SIZE))
1678+
elseif (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)

[8]ページ先頭

©2009-2025 Movatter.jp