Skip to content

Commit 3fbad03

Browse files
committed
Clarify comment on multixid offset wraparound check
Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment about it. The same code exists in backbranches in the server GetMultiXactIdMembers() function and in 'master' in the pg_upgrade GetOldMultiXactIdSingleMember function. In backbranches Coverity didn't complain about it because the check was merely an assertion, but change the comment in all supported branches for consistency. Per Tom Lane's suggestion. Discussion: https://www.postgresql.org/message-id/1827755.1765752936@sss.pgh.pa.us
1 parent 580b5c2 commit 3fbad03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/access/transam/multixact.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,10 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
16081608

16091609
if (!TransactionIdIsValid(*xactptr))
16101610
{
1611-
/* Corner case 2: we must be looking at unused slot zero */
1611+
/*
1612+
* Corner case 2: offset must have wrapped around to unused slot
1613+
* zero.
1614+
*/
16121615
Assert(offset == 0);
16131616
continue;
16141617
}

0 commit comments

Comments
 (0)