def METHOD_NAME(config):
    common.initialize_temp_dir(config.temp_dir)
    common.initialize_citus_cluster(
        config.old_bindir, config.old_datadir, config.settings, config
    )
    common.run_pg_regress(
        config.old_bindir,
        config.pg_srcdir,
        config.coordinator_port(),
        BEFORE_PG_UPGRADE_SCHEDULE,
    )
    common.run_pg_regress(
        config.old_bindir,
        config.pg_srcdir,
        config.coordinator_port(),
        AFTER_PG_UPGRADE_SCHEDULE,
    )
    citus_prepare_pg_upgrade(config.old_bindir, config.node_name_to_ports.values())
    # prepare should be idempotent, calling it a second time should never fail.
    citus_prepare_pg_upgrade(config.old_bindir, config.node_name_to_ports.values())
    common.stop_databases(
        config.old_bindir, config.old_datadir, config.node_name_to_ports, config.name
    )
    common.initialize_db_for_cluster(
        config.new_bindir,
        config.new_datadir,
        config.settings,
        config.node_name_to_ports.keys(),
    )
    perform_postgres_upgrade(
        config.old_bindir,
        config.new_bindir,
        config.old_datadir,
        config.new_datadir,
        config.node_name_to_ports.keys(),
    )
    common.start_databases(
        config.new_bindir,
        config.new_datadir,
        config.node_name_to_ports,
        config.name,
        {},
    )
    citus_finish_pg_upgrade(config.new_bindir, config.node_name_to_ports.values())
    common.run_pg_regress(
        config.new_bindir,
        config.pg_srcdir,
        config.coordinator_port(),
        AFTER_PG_UPGRADE_SCHEDULE,
    )