Content-Length: 258715 | pFad | https://github.com/postgrespro/postgres/commit/7be47c56af3d3013955c91c2877c08f2a0e3e6a2

43 Fix incorrect math in DetermineSafeOldestOffset. · postgrespro/postgres@7be47c5 · GitHub
Skip to content

Commit 7be47c5

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 82ec7c9 commit 7be47c5

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
@@ -2495,7 +2495,8 @@ DetermineSafeOldestOffset(MultiXactId oldestMXact)
24952495
*/
24962496
oldestOffset = find_multixact_start(oldestMXact);
24972497
/* move back to start of the corresponding segment */
2498-
oldestOffset -= oldestOffset / MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT;
2498+
oldestOffset -= oldestOffset %
2499+
(MULTIXACT_MEMBERS_PER_PAGE * SLRU_PAGES_PER_SEGMENT);
24992500

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

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/7be47c56af3d3013955c91c2877c08f2a0e3e6a2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy