pgsql: Fix off-by-one error in calculating subtrans/multixact truncatio - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix off-by-one error in calculating subtrans/multixact truncatio
Date
Msg-id E1ZI2YC-0001xH-FT@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6ae9a021893b5cd24e1d7e8a1a07854d33af9990

Modified Files
--------------
src/backend/access/transam/multixact.c |   12 ++++++++++--
src/backend/access/transam/subtrans.c  |    7 ++++++-
2 files changed, 16 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix off-by-one error in calculating subtrans/multixact truncatio
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix off-by-one error in calculating subtrans/multixact truncatio