pgsql: Reduce the scope of volatile qualifiers

Started by Peter Eisentraut5 months ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Reduce the scope of volatile qualifiers

Commit c66a7d75e652 introduced a new "cast discards ‘volatile’"
warning (-Wcast-qual) in vac_truncate_clog().

Instead of making use of unvolatize(), remove the warning by reducing the
scope of the volatile qualifier (added in commit 2d2e40e3bef) to only
2 fields.

Also do the same for vac_update_datfrozenxid(), since the intent of
commit f65ab862e3b was to prevent the same kind of race condition that
commit 2d2e40e3bef was fixing.

Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: /messages/by-id/aZ3a+V82uSfEjDmD@ip-10-97-1-34.eu-west-3.compute.internal

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f2d7570cdde75fd67acb279063b2701806662035

Modified Files
--------------
src/backend/commands/vacuum.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)