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

Commitd3821e7

Browse files
committed
Code review for multixact bugfix
Reword messages, rename a confusingly named function.Per Robert Haas.
1 parentcbf9f0e commitd3821e7

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

‎src/backend/access/transam/multixact.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers);
347347
staticvoidDetermineSafeOldestOffset(MultiXactIdoldestMXact);
348348
staticboolMultiXactOffsetWouldWrap(MultiXactOffsetboundary,
349349
MultiXactOffsetstart,uint32distance);
350-
staticMultiXactOffsetread_offset_for_multi(MultiXactIdmulti);
350+
staticMultiXactOffsetfind_multixact_start(MultiXactIdmulti);
351351
staticvoidWriteMZeroPageXlogRec(intpageno,uint8info);
352352

353353

@@ -1074,12 +1074,12 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
10741074
ereport(ERROR,
10751075
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
10761076
errmsg("multixact \"members\" limit exceeded"),
1077-
errdetail_plural("This command would create a multixact with %u members,which exceeds remaining space(%u member.)",
1078-
"This command would create a multixact with %u members,which exceeds remaining space(%u members.)",
1077+
errdetail_plural("This command would create a multixact with %u members,but the remaining spaceis only enough for%u member.",
1078+
"This command would create a multixact with %u members,but the remaining spaceis only enough for%u members.",
10791079
MultiXactState->offsetStopLimit-nextOffset-1,
10801080
nmembers,
10811081
MultiXactState->offsetStopLimit-nextOffset-1),
1082-
errhint("Execute a database-wide VACUUM in database with OID %u, with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.",
1082+
errhint("Execute a database-wide VACUUM in database with OID %u with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.",
10831083
MultiXactState->oldestMultiXactDB)));
10841084
elseif (MultiXactOffsetWouldWrap(MultiXactState->offsetStopLimit,
10851085
nextOffset,
@@ -1089,7 +1089,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
10891089
errmsg("database with OID %u must be vacuumed before %d more multixact members are used",
10901090
MultiXactState->oldestMultiXactDB,
10911091
MultiXactState->offsetStopLimit-nextOffset+nmembers),
1092-
errhint("Execute a database-wide VACUUM in that database, with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
1092+
errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
10931093

10941094
ExtendMultiXactMember(nextOffset,nmembers);
10951095

@@ -2487,7 +2487,7 @@ DetermineSafeOldestOffset(MultiXactId oldestMXact)
24872487
* one-segment hole at a minimum. We start spewing warnings a few
24882488
* complete segments before that.
24892489
*/
2490-
oldestOffset=read_offset_for_multi(oldestMXact);
2490+
oldestOffset=find_multixact_start(oldestMXact);
24912491
/* move back to start of the corresponding segment */
24922492
oldestOffset-=oldestOffset /MULTIXACT_MEMBERS_PER_PAGE*SLRU_PAGES_PER_SEGMENT;
24932493

@@ -2543,20 +2543,16 @@ MultiXactOffsetWouldWrap(MultiXactOffset boundary, MultiXactOffset start,
25432543
*-----------------------------------------------------------------------
25442544
*/
25452545
if (start<boundary)
2546-
{
25472546
returnfinish >=boundary||finish<start;
2548-
}
25492547
else
2550-
{
25512548
returnfinish >=boundary&&finish<start;
2552-
}
25532549
}
25542550

25552551
/*
2556-
*Read the offset of thefirst member of thegivenmultixact.
2552+
*Find thestartingoffset of the givenMultiXactId.
25572553
*/
25582554
staticMultiXactOffset
2559-
read_offset_for_multi(MultiXactIdmulti)
2555+
find_multixact_start(MultiXactIdmulti)
25602556
{
25612557
MultiXactOffsetoffset;
25622558
intpageno;
@@ -2709,7 +2705,7 @@ TruncateMultiXact(void)
27092705
* First, compute the safe truncation point for MultiXactMember. This is
27102706
* the starting offset of the oldest multixact.
27112707
*/
2712-
oldestOffset=read_offset_for_multi(oldestMXact);
2708+
oldestOffset=find_multixact_start(oldestMXact);
27132709

27142710
/*
27152711
* To truncate MultiXactMembers, we need to figure out the active page

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp