]> granicus.if.org Git - postgresql/commit
Fix off-by-one error in calculating subtrans/multixact truncation point.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 22 Jul 2015 22:30:19 +0000 (01:30 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 22 Jul 2015 22:30:19 +0000 (01:30 +0300)
commit40ad7822019a2cf8b9e0d5bd770490af7b56e652
treec4c3b6cf666cb1c2d07b4506a97a294334b5df3a
parent4c11967e7348b79a27738a6f714d61325c660c5b
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.
src/backend/access/transam/multixact.c
src/backend/access/transam/subtrans.c
src/include/access/multixact.h