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

Commit9ae6c11

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

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
@@ -345,7 +345,7 @@ static void ExtendMultiXactMember(MultiXactOffset offset, int nmembers);
345345
staticvoidDetermineSafeOldestOffset(MultiXactIdoldestMXact);
346346
staticboolMultiXactOffsetWouldWrap(MultiXactOffsetboundary,
347347
MultiXactOffsetstart,uint32distance);
348-
staticMultiXactOffsetread_offset_for_multi(MultiXactIdmulti);
348+
staticMultiXactOffsetfind_multixact_start(MultiXactIdmulti);
349349
staticvoidWriteMZeroPageXlogRec(intpageno,uint8info);
350350

351351

@@ -1079,12 +1079,12 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
10791079
ereport(ERROR,
10801080
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
10811081
errmsg("multixact \"members\" limit exceeded"),
1082-
errdetail_plural("This command would create a multixact with %u members,which exceeds remaining space(%u member.)",
1083-
"This command would create a multixact with %u members,which exceeds remaining space(%u members.)",
1082+
errdetail_plural("This command would create a multixact with %u members,but the remaining spaceis only enough for%u member.",
1083+
"This command would create a multixact with %u members,but the remaining spaceis only enough for%u members.",
10841084
MultiXactState->offsetStopLimit-nextOffset-1,
10851085
nmembers,
10861086
MultiXactState->offsetStopLimit-nextOffset-1),
1087-
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.",
1087+
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.",
10881088
MultiXactState->oldestMultiXactDB)));
10891089
elseif (MultiXactOffsetWouldWrap(MultiXactState->offsetStopLimit,
10901090
nextOffset,
@@ -1094,7 +1094,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
10941094
errmsg("database with OID %u must be vacuumed before %d more multixact members are used",
10951095
MultiXactState->oldestMultiXactDB,
10961096
MultiXactState->offsetStopLimit-nextOffset+nmembers),
1097-
errhint("Execute a database-wide VACUUM in that database, with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
1097+
errhint("Execute a database-wide VACUUM in that database with reduced vacuum_multixact_freeze_min_age and vacuum_multixact_freeze_table_age settings.")));
10981098

10991099
ExtendMultiXactMember(nextOffset,nmembers);
11001100

@@ -2506,7 +2506,7 @@ DetermineSafeOldestOffset(MultiXactId oldestMXact)
25062506
* one-segment hole at a minimum. We start spewing warnings a few
25072507
* complete segments before that.
25082508
*/
2509-
oldestOffset=read_offset_for_multi(oldestMXact);
2509+
oldestOffset=find_multixact_start(oldestMXact);
25102510
/* move back to start of the corresponding segment */
25112511
oldestOffset-=oldestOffset /MULTIXACT_MEMBERS_PER_PAGE*SLRU_PAGES_PER_SEGMENT;
25122512

@@ -2562,20 +2562,16 @@ MultiXactOffsetWouldWrap(MultiXactOffset boundary, MultiXactOffset start,
25622562
*-----------------------------------------------------------------------
25632563
*/
25642564
if (start<boundary)
2565-
{
25662565
returnfinish >=boundary||finish<start;
2567-
}
25682566
else
2569-
{
25702567
returnfinish >=boundary&&finish<start;
2571-
}
25722568
}
25732569

25742570
/*
2575-
*Read the offset of thefirst member of thegivenmultixact.
2571+
*Find thestartingoffset of the givenMultiXactId.
25762572
*/
25772573
staticMultiXactOffset
2578-
read_offset_for_multi(MultiXactIdmulti)
2574+
find_multixact_start(MultiXactIdmulti)
25792575
{
25802576
MultiXactOffsetoffset;
25812577
intpageno;
@@ -2728,7 +2724,7 @@ TruncateMultiXact(void)
27282724
* First, compute the safe truncation point for MultiXactMember. This is
27292725
* the starting offset of the oldest multixact.
27302726
*/
2731-
oldestOffset=read_offset_for_multi(oldestMXact);
2727+
oldestOffset=find_multixact_start(oldestMXact);
27322728

27332729
/*
27342730
* To truncate MultiXactMembers, we need to figure out the active page

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp