pgsql: Fetch XIDs atomically during vac_truncate_clog(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fetch XIDs atomically during vac_truncate_clog().
Date
Msg-id E1b5IJO-0002PL-EW@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fetch XIDs atomically during vac_truncate_clog().

Because vac_update_datfrozenxid() updates datfrozenxid and datminmxid
in-place, it's unsafe to assume that successive reads of those values will
give consistent results.  Fetch each one just once to ensure sane behavior
in the minimum calculation.  Noted while reviewing Alexander Korotkov's
patch in the same area.

Discussion: <8564.1464116473@sss.pgh.pa.us>

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/5551dac59c0601b49d57a3f897fb0a6d581e58ac

Modified Files
--------------
src/backend/commands/vacuum.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fetch XIDs atomically during vac_truncate_clog().
Next
From: Kevin Grittner
Date:
Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <