Skip to content

Commit 32c50af

Browse files
committed
Fix incorrect math in DetermineSafeOldestOffset.
The old formula didn't have enough parentheses, so it would do the wrong thing, and it used / rather than % to find a remainder. The effect of these oversights is that the stop point chosen by the logic introduced in commit b69bf30 might be rather meaningless. Thomas Munro, reviewed by Kevin Grittner, with a whitespace tweak by me.
1 parent 43ed068 commit 32c50af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/transam/multixact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,8 @@ DetermineSafeOldestOffset(MultiXactId oldestMXact)
25142514
*/
25152515
oldestOffset = find_multixact_start(oldestMXact);
25162516
/* move back to start of the corresponding segment */
2517-
oldestOffset -= oldestOffset / MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT;
2517+
oldestOffset -= oldestOffset %
2518+
(MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT);
25182519

25192520
LWLockAcquire(MultiXactGenLock, LW_EXCLUSIVE);
25202521
/* always leave one segment before the wraparound point */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy