]> 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:15 +0000 (01:30 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 22 Jul 2015 22:30:15 +0000 (01:30 +0300)
commit84330d0c1fd3dd76f95ce82dd5856a9de52b5b23
tree005af68a2fe929256e6226e0c4db7f58d2be523a
parent3cb6ef9983b5d7b45e7a5bd42c2cf8714f931850
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