Fix off-by-one error in calculating subtrans/multixact truncation point.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: a9b3a22aa18345451a20696fe272b6e02f5a2bbb
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2015-07-22T22:30:07Z
Releases: 9.5.0
Fix off-by-one error in calculating subtrans/multixact truncation point.

If there were no subtransactions (or multixacts) active, we would calculate
the oldestxid == next xid. That's correct, but if next XID happens to be
on the next pg_subtrans (pg_multixact) page, the page does not exist yet,
and SimpleLruTruncate will produce an "apparent wraparound" warning. The
warning is harmless in this case, but looks very alarming to users.

Backpatch to all supported versions. Patch and analysis by Thomas Munro.

Files