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/logging.h"
#include "common/pg_prng.h"
#include "common/restricted_token.h"
#include "fe_utils/recovery_gen.h"
#include "fe_utils/simple_list.h"
#include "fe_utils/string_utils.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 | USEC_PER_SEC 1000000 |
#define | WAIT_INTERVAL 1 /* 1 second */ |
Enumerations | |
enum | WaitPMResult { POSTMASTER_READY , POSTMASTER_STILL_STARTING , POSTMASTER_READY , POSTMASTER_STILL_STARTING , POSTMASTER_SHUTDOWN_IN_RECOVERY , POSTMASTER_FAILED } |
Functions | |
static void | cleanup_objects_atexit (void) |
static void | usage () |
static char * | get_base_conninfo (const char *conninfo, char **dbname) |
static char * | get_sub_conninfo (const struct CreateSubscriberOptions *opt) |
static char * | get_exec_path (const char *argv0, const char *progname) |
static void | check_data_directory (const char *datadir) |
static char * | concat_conninfo_dbname (const char *conninfo, const char *dbname) |
static struct LogicalRepInfo * | store_pub_sub_info (const struct CreateSubscriberOptions *opt, const char *pub_base_conninfo, const char *sub_base_conninfo) |
static PGconn * | connect_database (const char *conninfo, bool exit_on_error) |
static void | disconnect_database (PGconn *conn, bool exit_on_error) |
static uint64 | get_primary_sysid (const char *conninfo) |
static uint64 | get_standby_sysid (const char *datadir) |
static void | modify_subscriber_sysid (const struct CreateSubscriberOptions *opt) |
static bool | server_is_in_recovery (PGconn *conn) |
static char * | generate_object_name (PGconn *conn) |
static void | check_publisher (const struct LogicalRepInfo *dbinfo) |
static char * | setup_publisher (struct LogicalRepInfo *dbinfo) |
static void | check_subscriber (const struct LogicalRepInfo *dbinfo) |
static void | setup_subscriber (struct LogicalRepInfo *dbinfo, const char *consistent_lsn) |
static void | setup_recovery (const struct LogicalRepInfo *dbinfo, const char *datadir, const char *lsn) |
static void | drop_primary_replication_slot (struct LogicalRepInfo *dbinfo, const char *slotname) |
static void | drop_failover_replication_slots (struct LogicalRepInfo *dbinfo) |
static char * | create_logical_replication_slot (PGconn *conn, struct LogicalRepInfo *dbinfo) |
static void | drop_replication_slot (PGconn *conn, struct LogicalRepInfo *dbinfo, const char *slot_name) |
static void | pg_ctl_status (const char *pg_ctl_cmd, int rc) |
static void | start_standby_server (const struct CreateSubscriberOptions *opt, bool restricted_access, bool restrict_logical_worker) |
static void | stop_standby_server (const char *datadir) |
static void | wait_for_end_recovery (const char *conninfo, const struct CreateSubscriberOptions *opt) |
static void | create_publication (PGconn *conn, struct LogicalRepInfo *dbinfo) |
static void | drop_publication (PGconn *conn, const char *pubname, const char *dbname, bool *made_publication) |
static void | check_and_drop_publications (PGconn *conn, struct LogicalRepInfo *dbinfo) |
static void | create_subscription (PGconn *conn, const struct LogicalRepInfo *dbinfo) |
static void | set_replication_progress (PGconn *conn, const struct LogicalRepInfo *dbinfo, const char *lsn) |
static void | enable_subscription (PGconn *conn, const struct LogicalRepInfo *dbinfo) |
static void | check_and_drop_existing_subscriptions (PGconn *conn, const struct LogicalRepInfo *dbinfo) |
static void | drop_existing_subscriptions (PGconn *conn, const char *subname, const char *dbname) |
static void | get_publisher_databases (struct CreateSubscriberOptions *opt, bool dbnamespecified) |
static void | appendConnStrItem (PQExpBuffer buf, const char *keyword, const char *val) |
int | main (int argc, char **argv) |
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 char * | subscriber_dir = NULL |
static bool | recovery_ended = false |
static bool | standby_running = false |
#define DEFAULT_SUB_PORT "50432" |
Definition at line 31 of file pg_createsubscriber.c.
#define OBJECTTYPE_PUBLICATIONS 0x0001 |
Definition at line 32 of file pg_createsubscriber.c.
#define USEC_PER_SEC 1000000 |
Definition at line 131 of file pg_createsubscriber.c.
#define WAIT_INTERVAL 1 /* 1 second */ |
Definition at line 132 of file pg_createsubscriber.c.
enum WaitPMResult |
Enumerator | |
---|---|
POSTMASTER_READY | |
POSTMASTER_STILL_STARTING | |
POSTMASTER_READY | |
POSTMASTER_STILL_STARTING | |
POSTMASTER_SHUTDOWN_IN_RECOVERY | |
POSTMASTER_FAILED |
Definition at line 158 of file pg_createsubscriber.c.
|
static |
Definition at line 279 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 1151 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), PQExpBufferData::data, LogicalRepInfo::dbname, dbname, destroyPQExpBuffer(), disconnect_database(), drop_existing_subscriptions(), i, pg_log_error, PGRES_TUPLES_OK, PQclear(), PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), and PQresultStatus().
Referenced by setup_subscriber().
|
static |
Definition at line 1730 of file pg_createsubscriber.c.
References Assert(), conn, dbinfos, LogicalRepInfo::dbname, disconnect_database(), drop_publication(), dry_run, i, LogicalRepInfo::made_publication, OBJECTTYPE_PUBLICATIONS, LogicalRepInfos::objecttypes_to_remove, pg_log_error, pg_log_info, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), and LogicalRepInfo::pubname.
Referenced by setup_subscriber().
|
static |
Definition at line 407 of file pg_createsubscriber.c.
References datadir, MAXPGPATH, pg_fatal, pg_log_info, snprintf, and stat.
Referenced by main().
|
static |
Definition at line 870 of file pg_createsubscriber.c.
References conn, connect_database(), dbinfos, disconnect_database(), dry_run, num_dbs, pg_free(), pg_log_debug, pg_log_error, pg_log_error_hint, pg_log_info, pg_log_warning, pg_log_warning_detail, pg_log_warning_hint, pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQresultErrorMessage(), PQresultStatus(), server_is_in_recovery(), LogicalRepInfos::two_phase, and wal_level.
Referenced by main().
|
static |
Definition at line 1009 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), num_dbs, pg_log_debug, pg_log_error, pg_log_error_hint, pg_log_info, pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQresultErrorMessage(), PQresultStatus(), primary_slot_name, and server_is_in_recovery().
Referenced by main().
|
static |
Definition at line 177 of file pg_createsubscriber.c.
References conn, connect_database(), LogicalRepInfos::dbinfo, dbinfos, LogicalRepInfo::dbname, disconnect_database(), drop_publication(), drop_replication_slot(), i, LogicalRepInfo::made_publication, LogicalRepInfo::made_replslot, num_dbs, pg_log_warning, pg_log_warning_hint, LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, recovery_ended, LogicalRepInfo::replslotname, standby_running, stop_standby_server(), subscriber_dir, and success.
Referenced by main().
|
static |
Definition at line 439 of file pg_createsubscriber.c.
References appendConnStrItem(), appendPQExpBufferStr(), Assert(), buf, createPQExpBuffer(), dbname, destroyPQExpBuffer(), and pg_strdup().
Referenced by get_publisher_databases(), and store_pub_sub_info().
|
static |
Definition at line 536 of file pg_createsubscriber.c.
References ALWAYS_SECURE_SEARCH_PATH_SQL, conn, CONNECTION_OK, pg_log_error, PGRES_TUPLES_OK, PQclear(), PQconnectdb(), PQerrorMessage(), PQexec(), PQfinish(), PQresultErrorMessage(), PQresultStatus(), and PQstatus().
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 1359 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), dbinfos, LogicalRepInfo::dbname, destroyPQExpBuffer(), dry_run, LogicalRepInfo::made_replslot, pg_log_debug, pg_log_error, pg_log_info, pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue(), PQresultErrorMessage(), PQresultStatus(), LogicalRepInfo::replslotname, str, and LogicalRepInfos::two_phase.
Referenced by setup_publisher().
|
static |
Definition at line 1603 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, LogicalRepInfo::made_publication, pg_log_debug, pg_log_error, pg_log_error_hint, pg_log_info, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PQclear(), PQescapeIdentifier(), PQescapeLiteral(), PQexec(), PQfreemem(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), LogicalRepInfo::pubname, resetPQExpBuffer(), and str.
Referenced by setup_publisher().
|
static |
Definition at line 1781 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), dbinfos, LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, pg_log_debug, pg_log_error, pg_log_info, PGRES_COMMAND_OK, PQclear(), PQescapeIdentifier(), PQescapeLiteral(), PQexec(), PQfreemem(), PQresultErrorMessage(), PQresultStatus(), LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, LogicalRepInfo::replslotname, str, LogicalRepInfo::subname, and LogicalRepInfos::two_phase.
Referenced by setup_subscriber().
|
static |
Definition at line 576 of file pg_createsubscriber.c.
References Assert(), conn, 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_subscriptions(), drop_failover_replication_slots(), drop_primary_replication_slot(), enable_subscription(), 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 1110 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), PQExpBufferData::data, dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, pg_log_error, pg_log_info, PGRES_COMMAND_OK, PQclear(), PQexec(), PQresultErrorMessage(), PQresultStatus(), and subname.
Referenced by check_and_drop_existing_subscriptions().
|
static |
Definition at line 1317 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), drop_replication_slot(), i, pg_log_warning, pg_log_warning_hint, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), and PQresultStatus().
Referenced by main().
|
static |
Definition at line 1287 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), drop_replication_slot(), pg_log_warning, pg_log_warning_hint, and primary_slot_name.
Referenced by main().
|
static |
Definition at line 1677 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), dbname, destroyPQExpBuffer(), dry_run, pg_log_debug, pg_log_error, pg_log_info, PGRES_COMMAND_OK, PQclear(), PQescapeIdentifier(), PQexec(), PQfreemem(), PQresultErrorMessage(), PQresultStatus(), and str.
Referenced by check_and_drop_publications(), and cleanup_objects_atexit().
|
static |
Definition at line 1409 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), dry_run, LogicalRepInfo::made_replslot, pg_log_debug, pg_log_error, pg_log_info, PGRES_TUPLES_OK, PQclear(), PQescapeLiteral(), PQexec(), PQfreemem(), PQresultErrorMessage(), PQresultStatus(), and str.
Referenced by cleanup_objects_atexit(), drop_failover_replication_slots(), and drop_primary_replication_slot().
|
static |
Definition at line 1931 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), LogicalRepInfo::dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, pg_log_debug, pg_log_error, pg_log_info, PGRES_COMMAND_OK, PQclear(), PQescapeIdentifier(), PQexec(), PQfreemem(), PQresultErrorMessage(), PQresultStatus(), str, LogicalRepInfo::subname, and subname.
Referenced by setup_subscriber().
|
static |
Definition at line 714 of file pg_createsubscriber.c.
References conn, disconnect_database(), pg_log_error, pg_prng_uint32(), PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), prng_state, and psprintf().
Referenced by setup_publisher().
|
static |
Definition at line 301 of file pg_createsubscriber.c.
References appendConnStrItem(), buf, createPQExpBuffer(), dbname, destroyPQExpBuffer(), errmsg(), _PQconninfoOption::keyword, pg_log_error, pg_strdup(), PQconninfoFree(), PQconninfoParse(), PQfreemem(), and _PQconninfoOption::val.
Referenced by main().
|
static |
Definition at line 371 of file pg_createsubscriber.c.
References argv0, exec_path, find_my_exec(), find_other_exec(), MAXPGPATH, pg_fatal, pg_log_debug, pg_malloc(), progname, psprintf(), and strlcpy().
Referenced by main().
|
static |
Definition at line 591 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), pg_log_error, pg_log_info, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), and PQresultStatus().
Referenced by main().
|
static |
Definition at line 1971 of file pg_createsubscriber.c.
References concat_conninfo_dbname(), conn, connect_database(), CreateSubscriberOptions::database_names, dbname, disconnect_database(), i, num_dbs, pg_free(), pg_log_error, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), CreateSubscriberOptions::pub_conninfo_str, and simple_string_list_append().
Referenced by main().
|
static |
Definition at line 631 of file pg_createsubscriber.c.
References datadir, get_controlfile(), pg_fatal, pg_free(), pg_log_info, and ControlFileData::system_identifier.
Referenced by main().
|
static |
Definition at line 345 of file pg_createsubscriber.c.
References appendConnStrItem(), buf, createPQExpBuffer(), destroyPQExpBuffer(), pg_strdup(), progname, CreateSubscriberOptions::socket_dir, CreateSubscriberOptions::sub_port, and CreateSubscriberOptions::sub_username.
Referenced by main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 2019 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, get_base_conninfo(), get_exec_path(), get_primary_sysid(), get_progname(), get_publisher_databases(), get_restricted_token(), get_standby_sysid(), get_sub_conninfo(), getopt_long(), SimpleStringList::head, MAXPGPATH, modify_subscriber_sysid(), SimpleStringListCell::next, no_argument, num_dbs, num_pubs, num_replslots, num_subs, OBJECTTYPE_PUBLICATIONS, CreateSubscriberOptions::objecttypes_to_remove, LogicalRepInfos::objecttypes_to_remove, optarg, optind, pg_ctl_path, pg_fatal, pg_log_error, pg_log_error_detail, pg_log_error_hint, pg_log_info, PG_LOG_WARNING, pg_logging_increase_verbosity(), pg_logging_init(), pg_logging_set_level(), pg_resetwal_path, pg_strcasecmp(), pg_strdup(), PG_TEXTDOMAIN, primary_slot_name, progname, CreateSubscriberOptions::pub_conninfo_str, CreateSubscriberOptions::pub_names, LogicalRepInfo::pubconninfo, CreateSubscriberOptions::recovery_timeout, CreateSubscriberOptions::replslot_names, 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().
|
static |
Definition at line 658 of file pg_createsubscriber.c.
References DEVNULL, dry_run, get_controlfile(), gettimeofday(), pg_fatal, pg_free(), pg_log_debug, pg_log_info, pg_resetwal_path, psprintf(), subscriber_dir, ControlFileData::system_identifier, update_controlfile(), and wait_result_to_str().
Referenced by main().
|
static |
Definition at line 1449 of file pg_createsubscriber.c.
References pg_log_error, pg_log_error_detail, pg_strsignal(), WEXITSTATUS, WIFEXITED, WIFSIGNALED, and WTERMSIG.
Referenced by start_standby_server(), and stop_standby_server().
|
static |
Definition at line 842 of file pg_createsubscriber.c.
References conn, disconnect_database(), pg_log_error, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetvalue(), PQresultErrorMessage(), and PQresultStatus().
Referenced by check_publisher(), check_subscriber(), and wait_for_end_recovery().
|
static |
Definition at line 1840 of file pg_createsubscriber.c.
References appendPQExpBuffer(), Assert(), conn, createPQExpBuffer(), LogicalRepInfo::dbname, dbname, destroyPQExpBuffer(), disconnect_database(), dry_run, InvalidOid, InvalidXLogRecPtr, LSN_FORMAT_ARGS, pg_free(), pg_log_debug, pg_log_error, pg_log_info, PGRES_TUPLES_OK, PQclear(), PQescapeLiteral(), PQexec(), PQfreemem(), PQgetvalue(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), psprintf(), resetPQExpBuffer(), str, LogicalRepInfo::subname, and subname.
Referenced by setup_subscriber().
|
static |
Definition at line 763 of file pg_createsubscriber.c.
References conn, connect_database(), create_logical_replication_slot(), create_publication(), disconnect_database(), dry_run, generate_object_name(), i, num_dbs, num_pubs, num_replslots, num_subs, pg_free(), pg_log_error, pg_log_info, pg_prng_seed(), pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQexec(), PQresultErrorMessage(), PQresultStatus(), prng_state, LogicalRepInfo::pubname, LogicalRepInfo::replslotname, LogicalRepInfo::subname, and subname.
Referenced by main().
|
static |
Definition at line 1227 of file pg_createsubscriber.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), conn, connect_database(), PQExpBufferData::data, datadir, disconnect_database(), dry_run, GenerateRecoveryConfig(), InvalidXLogRecPtr, LSN_FORMAT_ARGS, pg_log_debug, recoveryconfcontents, and WriteRecoveryConfig().
Referenced by main().
|
static |
Definition at line 1191 of file pg_createsubscriber.c.
References check_and_drop_existing_subscriptions(), check_and_drop_publications(), conn, connect_database(), create_subscription(), disconnect_database(), enable_subscription(), i, num_dbs, and set_replication_progress().
Referenced by main().
|
static |
Definition at line 1479 of file pg_createsubscriber.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendShellString(), CreateSubscriberOptions::config_file, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), pg_ctl_path, pg_ctl_status(), pg_log_debug, pg_log_info, CreateSubscriberOptions::socket_dir, standby_running, CreateSubscriberOptions::sub_port, and subscriber_dir.
Referenced by main().
|
static |
Definition at line 1527 of file pg_createsubscriber.c.
References datadir, pg_ctl_path, pg_ctl_status(), pg_log_debug, pg_log_info, psprintf(), and standby_running.
Referenced by cleanup_objects_atexit(), main(), and wait_for_end_recovery().
|
static |
Definition at line 463 of file pg_createsubscriber.c.
References concat_conninfo_dbname(), CreateSubscriberOptions::database_names, dbinfos, LogicalRepInfo::dbname, SimpleStringList::head, i, LogicalRepInfo::made_publication, LogicalRepInfo::made_replslot, SimpleStringListCell::next, num_dbs, num_pubs, num_replslots, num_subs, pg_log_debug, pg_malloc_array, CreateSubscriberOptions::pub_names, LogicalRepInfo::pubconninfo, LogicalRepInfo::pubname, CreateSubscriberOptions::replslot_names, LogicalRepInfo::replslotname, CreateSubscriberOptions::sub_names, LogicalRepInfo::subconninfo, LogicalRepInfo::subname, subname, LogicalRepInfos::two_phase, and SimpleStringListCell::val.
Referenced by main().
|
static |
Definition at line 242 of file pg_createsubscriber.c.
References _, DEFAULT_SUB_PORT, printf, and progname.
Referenced by main().
|
static |
Definition at line 1551 of file pg_createsubscriber.c.
References conn, connect_database(), disconnect_database(), dry_run, pg_fatal, pg_log_error, pg_log_info, pg_log_info_hint, pg_usleep(), POSTMASTER_READY, POSTMASTER_STILL_STARTING, recovery_ended, CreateSubscriberOptions::recovery_timeout, server_is_in_recovery(), stop_standby_server(), subscriber_dir, USEC_PER_SEC, and WAIT_INTERVAL.
Referenced by main().
|
static |
Definition at line 141 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().
|
static |
Definition at line 137 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_subscriptions(), 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().
|
static |
Definition at line 142 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 143 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
|
static |
Definition at line 145 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
|
static |
Definition at line 144 of file pg_createsubscriber.c.
Referenced by main(), setup_publisher(), and store_pub_sub_info().
|
static |
Definition at line 149 of file pg_createsubscriber.c.
Referenced by main(), start_standby_server(), and stop_standby_server().
|
static |
Definition at line 150 of file pg_createsubscriber.c.
Referenced by main(), and modify_subscriber_sysid().
|
static |
Definition at line 136 of file pg_createsubscriber.c.
Referenced by check_subscriber(), drop_primary_replication_slot(), and main().
|
static |
Definition at line 147 of file pg_createsubscriber.c.
Referenced by generate_object_name(), and setup_publisher().
|
static |
Definition at line 134 of file pg_createsubscriber.c.
Referenced by get_exec_path(), get_sub_conninfo(), main(), and usage().
|
static |
Definition at line 155 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), and wait_for_end_recovery().
|
static |
Definition at line 156 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), start_standby_server(), and stop_standby_server().
|
static |
Definition at line 153 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), main(), modify_subscriber_sysid(), start_standby_server(), and wait_for_end_recovery().
|
static |
Definition at line 139 of file pg_createsubscriber.c.
Referenced by cleanup_objects_atexit(), and main().