|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include <sys/stat.h>#include <sys/time.h>#include <sys/wait.h>#include "common/connect.h"#include "common/controldata_utils.h"#include "common/file_perm.h"#include "common/file_utils.h"#include "common/logging.h"#include "common/pg_prng.h"#include "common/restricted_token.h"#include "datatype/timestamp.h"#include "fe_utils/recovery_gen.h"#include "fe_utils/simple_list.h"#include "fe_utils/string_utils.h"#include "fe_utils/version.h"#include "getopt_long.h"
Go to the source code of this file.
Data Structures | |
| struct | CreateSubscriberOptions |
| struct | LogicalRepInfo |
| struct | LogicalRepInfos |
Macros | |
| #define | DEFAULT_SUB_PORT "50432" |
| #define | OBJECTTYPE_PUBLICATIONS 0x0001 |
| #define | PG_AUTOCONF_FILENAME "postgresql.auto.conf" |
| #define | INCLUDED_CONF_FILE "pg_createsubscriber.conf" |
| #define | INCLUDED_CONF_FILE_DISABLED INCLUDED_CONF_FILE ".disabled" |
| #define | SERVER_LOG_FILE_NAME "pg_createsubscriber_server.log" |
| #define | INTERNAL_LOG_FILE_NAME "pg_createsubscriber_internal.log" |
| #define | WAIT_INTERVAL 1 /* 1 second */ |
Variables | |
| static const char * | progname |
| static char * | primary_slot_name = NULL |
| static bool | dry_run = false |
| static bool | success = false |
| static struct LogicalRepInfos | dbinfos |
| static int | num_dbs = 0 |
| static int | num_pubs = 0 |
| static int | num_subs = 0 |
| static int | num_replslots = 0 |
| static pg_prng_state | prng_state |
| static char * | pg_ctl_path = NULL |
| static char * | pg_resetwal_path = NULL |
| static FILE * | internal_log_file_fp = NULL |
| static char | logdir [MAXPGPATH] |
| static char * | subscriber_dir = NULL |
| static bool | recovery_ended = false |
| static bool | standby_running = false |
| static bool | recovery_params_set = false |
| #define DEFAULT_SUB_PORT "50432" |
Definition at line 35 of file pg_createsubscriber.c.
| #define INCLUDED_CONF_FILE "pg_createsubscriber.conf" |
Definition at line 50 of file pg_createsubscriber.c.
| #define INCLUDED_CONF_FILE_DISABLED INCLUDED_CONF_FILE ".disabled" |
Definition at line 51 of file pg_createsubscriber.c.
| #define INTERNAL_LOG_FILE_NAME "pg_createsubscriber_internal.log" |
Definition at line 54 of file pg_createsubscriber.c.
| #define OBJECTTYPE_PUBLICATIONS 0x0001 |
Definition at line 36 of file pg_createsubscriber.c.
| #define PG_AUTOCONF_FILENAME "postgresql.auto.conf" |
Definition at line 49 of file pg_createsubscriber.c.
| #define SERVER_LOG_FILE_NAME "pg_createsubscriber_server.log" |
Definition at line 53 of file pg_createsubscriber.c.
| #define WAIT_INTERVAL 1 /* 1 second */ |
Definition at line 167 of file pg_createsubscriber.c.
Definition at line 397 of file pg_createsubscriber.c.
References appendConnStrVal(), appendPQExpBufferChar(), appendPQExpBufferStr(), buf, and val.
Referenced by concat_conninfo_dbname(), get_base_conninfo(), and get_sub_conninfo().
|
static |
Definition at line 1500 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), PQExpBufferData::data, LogicalRepInfo::dbname, dbname, destroyPQExpBuffer(), disconnect_database(), drop_existing_subscription(), fb(), i, PG_LOG_ERROR, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, and report_createsub_log().
Referenced by setup_subscriber().
|
static |
Definition at line 2167 of file pg_createsubscriber.c.
References Assert, conn, dbinfos, LogicalRepInfo::dbname, disconnect_database(), drop_publication(), dry_run, fb(), i, LogicalRepInfo::made_publication, OBJECTTYPE_PUBLICATIONS, LogicalRepInfos::objecttypes_to_clean, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, LogicalRepInfo::pubname, and report_createsub_log().
Referenced by setup_subscriber().
Definition at line 527 of file pg_createsubscriber.c.
References datadir, fb(), GET_PG_MAJORVERSION_NUM, get_pg_version(), PG_LOG_DETAIL, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, report_createsub_fatal(), report_createsub_log(), and stat.
Referenced by main().
|
static |
Definition at line 1180 of file pg_createsubscriber.c.
References conn, connect_database(), dbinfos, disconnect_database(), dry_run, fb(), num_dbs, pg_free(), PG_LOG_DEBUG, PG_LOG_DETAIL, PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_INFO, PG_LOG_PRIMARY, PG_LOG_WARNING, pg_strdup(), PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQresultErrorMessage, PQresultStatus, report_createsub_log(), server_is_in_recovery(), LogicalRepInfos::two_phase, and wal_level.
Referenced by main().
|
static |
Definition at line 1339 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), fb(), num_dbs, PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_INFO, PG_LOG_PRIMARY, pg_strdup(), PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQresultErrorMessage, PQresultStatus, primary_slot_name, report_createsub_log(), and server_is_in_recovery().
Referenced by main().
Definition at line 269 of file pg_createsubscriber.c.
References conn, connect_database(), LogicalRepInfos::dbinfo, dbinfos, LogicalRepInfo::dbname, disconnect_database(), drop_publication(), drop_replication_slot(), durable_rename(), fb(), i, INCLUDED_CONF_FILE, INCLUDED_CONF_FILE_DISABLED, LogicalRepInfo::made_publication, LogicalRepInfo::made_replslot, MAXPGPATH, num_dbs, PG_LOG_HINT, PG_LOG_PRIMARY, PG_LOG_WARNING, LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, recovery_ended, recovery_params_set, LogicalRepInfo::replslotname, report_createsub_log(), snprintf, standby_running, stop_standby_server(), subscriber_dir, and success.
Referenced by main().
Definition at line 570 of file pg_createsubscriber.c.
References appendConnStrItem(), appendPQExpBufferStr(), Assert, buf, createPQExpBuffer(), dbname, destroyPQExpBuffer(), fb(), and pg_strdup().
Referenced by get_publisher_databases(), and store_pub_sub_info().
Definition at line 669 of file pg_createsubscriber.c.
References ALWAYS_SECURE_SEARCH_PATH_SQL, conn, CONNECTION_OK, fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQconnectdb(), PQerrorMessage(), PQexec(), PQfinish(), PQresultErrorMessage, PQresultStatus, PQstatus(), and report_createsub_log().
Referenced by check_publisher(), check_subscriber(), cleanup_objects_atexit(), drop_failover_replication_slots(), drop_primary_replication_slot(), get_primary_sysid(), get_publisher_databases(), setup_publisher(), setup_recovery(), setup_subscriber(), and wait_for_end_recovery().
|
static |
Definition at line 1750 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), dbinfos, LogicalRepInfo::dbname, destroyPQExpBuffer(), dry_run, fb(), LogicalRepInfo::made_replslot, PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, pg_strdup(), PGRES_TUPLES_OK, PQclear, PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue, PQresultErrorMessage, PQresultStatus, LogicalRepInfo::replslotname, report_createsub_log(), str, and LogicalRepInfos::two_phase.
Referenced by setup_publisher().
|
static |
Definition at line 2022 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, fb(), LogicalRepInfo::made_publication, PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQclear, PQescapeIdentifier(), PQescapeLiteral(), PQexec(), PQfreemem(), PQntuples, PQresultErrorMessage, PQresultStatus, LogicalRepInfo::pubname, report_createsub_log(), resetPQExpBuffer(), and str.
Referenced by setup_publisher().
|
static |
Definition at line 2232 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), dbinfos, LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, fb(), PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_COMMAND_OK, PQclear, PQescapeIdentifier(), PQescapeLiteral(), PQexec(), PQfreemem(), PQresultErrorMessage, PQresultStatus, LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, LogicalRepInfo::replslotname, report_createsub_log(), str, LogicalRepInfo::subname, and LogicalRepInfos::two_phase.
Referenced by setup_subscriber().
Definition at line 711 of file pg_createsubscriber.c.
References Assert, conn, fb(), and PQfinish().
Referenced by check_and_drop_existing_subscriptions(), check_and_drop_publications(), check_publisher(), check_subscriber(), cleanup_objects_atexit(), create_publication(), create_subscription(), drop_existing_subscription(), drop_failover_replication_slots(), drop_primary_replication_slot(), enable_subscription(), find_publication(), generate_object_name(), get_primary_sysid(), get_publisher_databases(), server_is_in_recovery(), set_replication_progress(), setup_publisher(), setup_recovery(), setup_subscriber(), and wait_for_end_recovery().
|
static |
Definition at line 1453 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), PQExpBufferData::data, dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, fb(), PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_COMMAND_OK, PQclear, PQexec(), PQresultErrorMessage, PQresultStatus, report_createsub_log(), and subname.
Referenced by check_and_drop_existing_subscriptions().
|
static |
Definition at line 1704 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), drop_replication_slot(), fb(), i, PG_LOG_HINT, PG_LOG_PRIMARY, PG_LOG_WARNING, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, and report_createsub_log().
Referenced by main().
|
static |
Definition at line 1672 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), drop_replication_slot(), fb(), PG_LOG_HINT, PG_LOG_PRIMARY, PG_LOG_WARNING, primary_slot_name, and report_createsub_log().
Referenced by main().
|
static |
Definition at line 2107 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), dbname, destroyPQExpBuffer(), dry_run, fb(), PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_COMMAND_OK, PQclear, PQescapeIdentifier(), PQexec(), PQfreemem(), PQresultErrorMessage, PQresultStatus, report_createsub_log(), and str.
Referenced by check_and_drop_publications(), and cleanup_objects_atexit().
|
static |
Definition at line 1808 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), dry_run, fb(), LogicalRepInfo::made_replslot, PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQescapeLiteral(), PQexec(), PQfreemem(), PQresultErrorMessage, PQresultStatus, report_createsub_log(), and str.
Referenced by cleanup_objects_atexit(), drop_failover_replication_slots(), and drop_primary_replication_slot().
|
static |
Definition at line 2400 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, fb(), PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_COMMAND_OK, PQclear, PQescapeIdentifier(), PQexec(), PQfreemem(), PQresultErrorMessage, PQresultStatus, report_createsub_log(), str, LogicalRepInfo::subname, and subname.
Referenced by setup_subscriber().
Definition at line 931 of file pg_createsubscriber.c.
References appendPQExpBuffer(), conn, createPQExpBuffer(), dbname, destroyPQExpBuffer(), disconnect_database(), fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQescapeLiteral(), PQexec(), PQfreemem(), PQntuples, PQresultStatus, report_createsub_log(), and str.
Referenced by setup_publisher().
Definition at line 883 of file pg_createsubscriber.c.
References conn, disconnect_database(), fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, pg_prng_uint32(), PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, prng_state, psprintf(), and report_createsub_log().
Referenced by setup_publisher().
Definition at line 419 of file pg_createsubscriber.c.
References appendConnStrItem(), buf, createPQExpBuffer(), dbname, destroyPQExpBuffer(), errmsg, fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, pg_strdup(), PQconninfoFree(), PQconninfoParse(), PQfreemem(), and report_createsub_log().
Referenced by main().
Definition at line 490 of file pg_createsubscriber.c.
References argv0, exec_path, fb(), find_my_exec(), find_other_exec(), MAXPGPATH, PG_LOG_DEBUG, PG_LOG_PRIMARY, pg_malloc(), progname, psprintf(), report_createsub_fatal(), report_createsub_log(), and strlcpy().
Referenced by main().
Definition at line 726 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), fb(), PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, and report_createsub_log().
Referenced by main().
|
static |
Definition at line 2448 of file pg_createsubscriber.c.
References concat_conninfo_dbname(), conn, connect_database(), CreateSubscriberOptions::database_names, dbname, disconnect_database(), fb(), i, num_dbs, pg_free(), PG_LOG_ERROR, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, CreateSubscriberOptions::pub_conninfo_str, report_createsub_log(), and simple_string_list_append().
Referenced by main().
Definition at line 770 of file pg_createsubscriber.c.
References datadir, fb(), get_controlfile(), pg_free(), PG_LOG_INFO, PG_LOG_PRIMARY, report_createsub_fatal(), and report_createsub_log().
Referenced by main().
|
static |
Definition at line 464 of file pg_createsubscriber.c.
References appendConnStrItem(), buf, createPQExpBuffer(), destroyPQExpBuffer(), fb(), pg_strdup(), progname, CreateSubscriberOptions::socket_dir, CreateSubscriberOptions::sub_port, and CreateSubscriberOptions::sub_username.
Referenced by main().
|
static |
Definition at line 1082 of file pg_createsubscriber.c.
References _, __pg_log_level, Assert, fb(), fprintf, internal_log_file_fp, PG_LOG_DETAIL, PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_PRIMARY, PG_LOG_WARNING, and vfprintf.
Referenced by report_createsub_log_v().
Definition at line 1125 of file pg_createsubscriber.c.
References fb(), filename, mode, and report_createsub_fatal().
Referenced by main().
Definition at line 2498 of file pg_createsubscriber.c.
References CreateSubscriberOptions::all_dbs, canonicalize_path(), check_data_directory(), check_publisher(), check_subscriber(), cleanup_objects_atexit(), CreateSubscriberOptions::config_file, CreateSubscriberOptions::database_names, LogicalRepInfos::dbinfo, dbinfos, DEFAULT_SUB_PORT, drop_failover_replication_slots(), drop_primary_replication_slot(), dry_run, fb(), get_base_conninfo(), get_exec_path(), get_primary_sysid(), get_progname(), get_publisher_databases(), get_restricted_token(), get_standby_sysid(), get_sub_conninfo(), GetDataDirectoryCreatePerm(), getopt_long(), SimpleStringList::head, internal_log_file_fp, INTERNAL_LOG_FILE_NAME, CreateSubscriberOptions::log_dir, logdir, logfile_open(), make_output_dirs(), MAXPGPATH, modify_subscriber_sysid(), no_argument, num_dbs, num_pubs, num_replslots, num_subs, OBJECTTYPE_PUBLICATIONS, CreateSubscriberOptions::objecttypes_to_clean, LogicalRepInfos::objecttypes_to_clean, optarg, optind, pg_ctl_path, pg_free(), PG_LOG_DETAIL, PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_INFO, PG_LOG_PRIMARY, PG_LOG_WARNING, pg_logging_increase_verbosity(), pg_logging_init(), pg_logging_set_level(), pg_mode_mask, PG_MODE_MASK_OWNER, pg_resetwal_path, pg_strcasecmp(), pg_strdup(), PG_TEXTDOMAIN, primary_slot_name, progname, psprintf(), CreateSubscriberOptions::pub_conninfo_str, CreateSubscriberOptions::pub_names, LogicalRepInfo::pubconninfo, CreateSubscriberOptions::recovery_timeout, CreateSubscriberOptions::replslot_names, report_createsub_fatal(), report_createsub_log(), required_argument, set_pglocale_pgservice(), setup_publisher(), setup_recovery(), setup_subscriber(), simple_string_list_append(), simple_string_list_member(), snprintf, CreateSubscriberOptions::socket_dir, start_standby_server(), stat, stop_standby_server(), store_pub_sub_info(), CreateSubscriberOptions::sub_names, CreateSubscriberOptions::sub_port, CreateSubscriberOptions::sub_username, LogicalRepInfo::subconninfo, subscriber_dir, success, CreateSubscriberOptions::two_phase, LogicalRepInfos::two_phase, usage(), and wait_for_end_recovery().
Definition at line 1139 of file pg_createsubscriber.c.
References fb(), gettimeofday(), len, logdir, MAXPGPATH, mkdir, now(), pg_dir_create_mode, report_createsub_fatal(), snprintf, and tm.
Referenced by main().
|
static |
Definition at line 799 of file pg_createsubscriber.c.
References DEVNULL, dry_run, fb(), get_controlfile(), gettimeofday(), CreateSubscriberOptions::log_dir, logdir, pg_free(), PG_LOG_DEBUG, PG_LOG_INFO, PG_LOG_PRIMARY, pg_resetwal_path, psprintf(), report_createsub_fatal(), report_createsub_log(), SERVER_LOG_FILE_NAME, subscriber_dir, update_controlfile(), and wait_result_to_str().
Referenced by main().
Definition at line 1856 of file pg_createsubscriber.c.
References fb(), PG_LOG_DETAIL, PG_LOG_ERROR, PG_LOG_PRIMARY, pg_strsignal(), report_createsub_log(), WEXITSTATUS, WIFEXITED, WIFSIGNALED, and WTERMSIG.
Referenced by start_standby_server(), and stop_standby_server().
|
static |
Definition at line 242 of file pg_createsubscriber.c.
References fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, and report_createsub_log_v().
Referenced by check_data_directory(), get_exec_path(), get_standby_sysid(), logfile_open(), main(), make_output_dirs(), modify_subscriber_sysid(), setup_recovery(), and wait_for_end_recovery().
|
static |
Definition at line 226 of file pg_createsubscriber.c.
References fb(), and report_createsub_log_v().
Referenced by check_and_drop_existing_subscriptions(), check_and_drop_publications(), check_data_directory(), check_publisher(), check_subscriber(), cleanup_objects_atexit(), connect_database(), create_logical_replication_slot(), create_publication(), create_subscription(), drop_existing_subscription(), drop_failover_replication_slots(), drop_primary_replication_slot(), drop_publication(), drop_replication_slot(), enable_subscription(), find_publication(), generate_object_name(), get_base_conninfo(), get_exec_path(), get_primary_sysid(), get_publisher_databases(), get_standby_sysid(), main(), modify_subscriber_sysid(), pg_ctl_status(), server_is_in_recovery(), set_replication_progress(), setup_publisher(), setup_recovery(), start_standby_server(), stop_standby_server(), store_pub_sub_info(), and wait_for_end_recovery().
|
static |
Definition at line 206 of file pg_createsubscriber.c.
References fb(), internal_log_file_fp, internal_log_file_write(), and pg_log_generic_v().
Referenced by report_createsub_fatal(), and report_createsub_log().
Definition at line 1058 of file pg_createsubscriber.c.
References conn, disconnect_database(), fb(), PG_LOG_ERROR, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetvalue, PQresultErrorMessage, PQresultStatus, and report_createsub_log().
Referenced by check_publisher(), check_subscriber(), and wait_for_end_recovery().
|
static |
Definition at line 2299 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert, conn, createPQExpBuffer(), LogicalRepInfo::dbname, dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, fb(), InvalidOid, InvalidXLogRecPtr, LSN_FORMAT_ARGS, pg_free(), PG_LOG_DEBUG, PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, PGRES_TUPLES_OK, PQclear, PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue, PQntuples, PQresultErrorMessage, PQresultStatus, psprintf(), report_createsub_log(), resetPQExpBuffer(), str, LogicalRepInfo::subname, and subname.
Referenced by setup_subscriber().
|
static |
Definition at line 968 of file pg_createsubscriber.c.
References conn, connect_database(), create_logical_replication_slot(), create_publication(), dbname, disconnect_database(), dry_run, fb(), find_publication(), generate_object_name(), i, LogicalRepInfo::made_publication, num_dbs, num_pubs, num_replslots, num_subs, pg_free(), PG_LOG_ERROR, PG_LOG_INFO, PG_LOG_PRIMARY, pg_prng_seed(), pg_strdup(), PGRES_TUPLES_OK, PQclear, PQexec(), PQresultErrorMessage, PQresultStatus, prng_state, LogicalRepInfo::pubname, LogicalRepInfo::replslotname, report_createsub_log(), LogicalRepInfo::subname, and subname.
Referenced by main().
|
static |
Definition at line 1577 of file pg_createsubscriber.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), conn, connect_database(), PQExpBufferData::data, datadir, disconnect_database(), dry_run, fb(), fd(), GenerateRecoveryConfig(), INCLUDED_CONF_FILE, InvalidXLogRecPtr, PQExpBufferData::len, LSN_FORMAT_ARGS, MAXPGPATH, PG_LOG_DEBUG, PG_LOG_PRIMARY, recovery_params_set, recoveryconfcontents, report_createsub_fatal(), report_createsub_log(), resetPQExpBuffer(), snprintf, and WriteRecoveryConfig().
Referenced by main().
|
static |
Definition at line 1541 of file pg_createsubscriber.c.
References check_and_drop_existing_subscriptions(), check_and_drop_publications(), conn, connect_database(), create_subscription(), disconnect_database(), enable_subscription(), fb(), i, num_dbs, and set_replication_progress().
Referenced by main().
|
static |
Definition at line 1893 of file pg_createsubscriber.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), CreateSubscriberOptions::config_file, createPQExpBuffer(), destroyPQExpBuffer(), fb(), CreateSubscriberOptions::log_dir, logdir, pg_ctl_path, pg_ctl_status(), PG_LOG_DEBUG, PG_LOG_INFO, PG_LOG_PRIMARY, report_createsub_log(), SERVER_LOG_FILE_NAME, CreateSubscriberOptions::socket_dir, standby_running, CreateSubscriberOptions::sub_port, and subscriber_dir.
Referenced by main().
Definition at line 1946 of file pg_createsubscriber.c.
References datadir, fb(), pg_ctl_path, pg_ctl_status(), PG_LOG_DEBUG, PG_LOG_INFO, PG_LOG_PRIMARY, psprintf(), report_createsub_log(), and standby_running.
Referenced by cleanup_objects_atexit(), main(), and wait_for_end_recovery().
|
static |
Definition at line 594 of file pg_createsubscriber.c.
References concat_conninfo_dbname(), CreateSubscriberOptions::database_names, dbinfos, LogicalRepInfo::dbname, fb(), SimpleStringList::head, i, LogicalRepInfo::made_publication, LogicalRepInfo::made_replslot, num_dbs, num_pubs, num_replslots, num_subs, PG_LOG_DEBUG, PG_LOG_PRIMARY, pg_malloc_array, CreateSubscriberOptions::pub_names, LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, CreateSubscriberOptions::replslot_names, LogicalRepInfo::replslotname, report_createsub_log(), CreateSubscriberOptions::sub_names, LogicalRepInfo::subconninfo, LogicalRepInfo::subname, subname, and LogicalRepInfos::two_phase.
Referenced by main().
Definition at line 359 of file pg_createsubscriber.c.
References _, DEFAULT_SUB_PORT, fb(), printf, and progname.
Referenced by main().
|
static |
Definition at line 1972 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), dry_run, fb(), PG_LOG_ERROR, PG_LOG_HINT, PG_LOG_INFO, PG_LOG_PRIMARY, pg_usleep(), recovery_ended, CreateSubscriberOptions::recovery_timeout, report_createsub_fatal(), report_createsub_log(), server_is_in_recovery(), stop_standby_server(), subscriber_dir, USECS_PER_SEC, and WAIT_INTERVAL.
Referenced by main().
|
static |
Definition at line 176 of file pg_createsubscriber.c.
Referenced by check_and_drop_publications(), check_publisher(), cleanup_objects_atexit(), create_logical_replication_slot(), create_subscription(), get_db_infos(), main(), and store_pub_sub_info().
Definition at line 172 of file pg_createsubscriber.c.
Referenced by check_and_drop_publications(), check_publisher(), copy_file(), create_logical_replication_slot(), create_publication(), create_subscription(), create_target_dir(), create_target_symlink(), debug_reconstruction(), drop_existing_subscription(), drop_publication(), drop_replication_slot(), enable_subscription(), main(), modify_subscriber_sysid(), open_target_file(), reconstruct_from_incremental_file(), remove_target_dir(), remove_target_file(), remove_target_symlink(), set_replication_progress(), setup_publisher(), setup_recovery(), sync_target_dir(), truncate_target_file(), wait_for_end_recovery(), write_reconstructed_file(), and write_target_range().
Definition at line 187 of file pg_createsubscriber.c.
Referenced by internal_log_file_write(), main(), and report_createsub_log_v().
Definition at line 188 of file pg_createsubscriber.c.
Referenced by main(), make_output_dirs(), modify_subscriber_sysid(), and start_standby_server().
|
static |
Definition at line 177 of file pg_createsubscriber.c.
Referenced by check_publisher(), check_subscriber(), cleanup_objects_atexit(), get_publisher_databases(), main(), setup_publisher(), setup_subscriber(), and store_pub_sub_info().
|
static |
Definition at line 178 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
|
static |
Definition at line 180 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
|
static |
Definition at line 179 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
Definition at line 184 of file pg_createsubscriber.c.
Referenced by main(), main(), start_standby_server(), and stop_standby_server().
Definition at line 185 of file pg_createsubscriber.c.
Referenced by main(), and modify_subscriber_sysid().
Definition at line 171 of file pg_createsubscriber.c.
Referenced by check_subscriber(), drop_primary_replication_slot(), and main().
|
static |
Definition at line 182 of file pg_createsubscriber.c.
Referenced by generate_object_name(), and setup_publisher().
Definition at line 169 of file pg_createsubscriber.c.
Referenced by get_exec_path(), get_sub_conninfo(), main(), and usage().
Definition at line 195 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), and wait_for_end_recovery().
Definition at line 197 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), and setup_recovery().
Definition at line 196 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), start_standby_server(), and stop_standby_server().
Definition at line 193 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), main(), modify_subscriber_sysid(), start_standby_server(), and wait_for_end_recovery().
Definition at line 174 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), and main().