Wrap multixact/members correctly during extension

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 03db7945961c449ddd42be883e226bb889270161
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2014-01-02T21:17:07Z
Releases: 9.3.3
Wrap multixact/members correctly during extension

In the 9.2 code for extending multixact/members, the logic was very
simple because the number of entries in a members page was a proper
divisor of 2^32, and thus at 2^32 wraparound the logic for page switch
was identical than at any other page boundary.  In commit 0ac5ad5134f I
failed to realize this and introduced code that was not able to go over
the 2^32 boundary.  Fix that by ensuring that when we reach the last
page of the last segment we correctly zero the initial page of the
initial segment, using correct uint32-wraparound-safe arithmetic.

Noticed while investigating bug #8673 reported by Serge Negodyuck, as
diagnosed by Andres Freund.

Files

PathChange+/−
src/backend/access/transam/multixact.c modified +19 −5