mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
Make vacuum failsafe_active globally visible
While vacuuming a table in failsafe mode, VacuumCostActive should not be re-enabled. This currently isn't a problem because vacuum cost parameters are only refreshed in between vacuuming tables and failsafe status is reset for every table. In preparation for allowing vacuum cost parameters to be updated more frequently, elevate LVRelState->failsafe_active to a global, VacuumFailsafeActive, which will be checked when determining whether or not to re-enable vacuum cost-related delays. Author: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Robert Haas <robertmhaas@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAAKRu_ZngzqnEODc7LmS1NH04Kt6Y9huSjz5pp7%2BDXhrjDA0gw%40mail.gmail.com
This commit is contained in:
@ -72,6 +72,21 @@ int vacuum_multixact_freeze_table_age;
|
||||
int vacuum_failsafe_age;
|
||||
int vacuum_multixact_failsafe_age;
|
||||
|
||||
/*
|
||||
* VacuumFailsafeActive is a defined as a global so that we can determine
|
||||
* whether or not to re-enable cost-based vacuum delay when vacuuming a table.
|
||||
* If failsafe mode has been engaged, we will not re-enable cost-based delay
|
||||
* for the table until after vacuuming has completed, regardless of other
|
||||
* settings.
|
||||
*
|
||||
* Only VACUUM code should inspect this variable and only table access methods
|
||||
* should set it to true. In Table AM-agnostic VACUUM code, this variable is
|
||||
* inspected to determine whether or not to allow cost-based delays. Table AMs
|
||||
* are free to set it if they desire this behavior, but it is false by default
|
||||
* and reset to false in between vacuuming each relation.
|
||||
*/
|
||||
bool VacuumFailsafeActive = false;
|
||||
|
||||
/*
|
||||
* Variables for cost-based parallel vacuum. See comments atop
|
||||
* compute_parallel_delay to understand how it works.
|
||||
|
Reference in New Issue
Block a user