diff options
author | Nathan Bossart <nathan@postgresql.org> | 2024-07-26 13:37:32 -0500 |
---|---|---|
committer | Nathan Bossart <nathan@postgresql.org> | 2024-07-26 13:37:32 -0500 |
commit | 4b56bb4ab4856070d5ea4aeafdd663d8bf96b874 (patch) | |
tree | 9e42b7aea4e5df2d3c9814da631fb11f767ea10e /src/backend/backup/basebackup_incremental.c | |
parent | 5d1d8b3c82c2a796bf7d89f2a5785ce9424acab1 (diff) | |
download | postgresql-4b56bb4ab4856070d5ea4aeafdd663d8bf96b874.tar.gz postgresql-4b56bb4ab4856070d5ea4aeafdd663d8bf96b874.zip |
pg_upgrade: Move live_check variable to user_opts.
At the moment, pg_upgrade stores whether it is doing a "live check"
(i.e., the user specified --check and the old server is still
running) in a local variable scoped to main(). This live_check
variable is passed to several functions. To further complicate
matters, a few call sites provide a hard-coded "false" as the
live_check argument. Specifically, this is done when calling these
functions for the new cluster, for which any live-check-only paths
won't apply.
This commit moves the live_check variable to the global user_opts
variable, which stores information about the options the user
specified on the command line. This allows us to remove the
live_check parameter from several functions. For the functions
with callers that provide a hard-coded "false" as the live_check
argument (e.g., get_control_data()), we verify the given cluster is
the old cluster before taking any live-check-only paths.
This small refactoring effort helps simplify some proposed changes
that would parallelize many of pg_upgrade's once-in-each-database
tasks using libpq's asynchronous APIs. By removing the live_check
parameter, we can more easily convert the functions to callbacks
for the new parallel system.
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20240516211638.GA1688936%40nathanxps13
Diffstat (limited to 'src/backend/backup/basebackup_incremental.c')
0 files changed, 0 insertions, 0 deletions