PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <dirent.h>
#include <signal.h>
#include <sys/stat.h>
#include <unistd.h>
#include "access/xlog_internal.h"
#include "common/file_perm.h"
#include "common/logging.h"
#include "getopt_long.h"
#include "libpq-fe.h"
#include "receivelog.h"
#include "streamutil.h"
Go to the source code of this file.
Macros | |
#define | RECONNECT_SLEEP_TIME 5 |
#define | IsCompressXLogFileName(fname) |
#define | IsPartialCompressXLogFileName(fname) |
Functions | |
static void | usage (void) |
static DIR * | get_destination_dir (char *dest_folder) |
static void | close_destination_dir (DIR *dest_dir, char *dest_folder) |
static XLogRecPtr | FindStreamingStart (uint32 *tli) |
static void | StreamLog (void) |
static bool | stop_streaming (XLogRecPtr segendpos, uint32 timeline, bool segment_finished) |
static void | disconnect_atexit (void) |
static void | sigint_handler (int signum) |
int | main (int argc, char **argv) |
Variables | |
static char * | basedir = NULL |
static int | verbose = 0 |
static int | compresslevel = 0 |
static int | noloop = 0 |
static int | standby_message_timeout = 10 * 1000 |
static volatile bool | time_to_stop = false |
static bool | do_create_slot = false |
static bool | slot_exists_ok = false |
static bool | do_drop_slot = false |
static bool | do_sync = true |
static bool | synchronous = false |
static char * | replication_slot = NULL |
static XLogRecPtr | endpos = InvalidXLogRecPtr |
#define IsCompressXLogFileName | ( | fname | ) |
Definition at line 65 of file pg_receivewal.c.
Referenced by FindStreamingStart().
#define IsPartialCompressXLogFileName | ( | fname | ) |
Definition at line 69 of file pg_receivewal.c.
Referenced by FindStreamingStart().
#define RECONNECT_SLEEP_TIME 5 |
Definition at line 31 of file pg_receivewal.c.
Referenced by main().
|
static |
Definition at line 181 of file pg_receivewal.c.
References Assert, closedir(), and pg_log_error.
Referenced by FindStreamingStart(), and main().
|
static |
Definition at line 58 of file pg_receivewal.c.
References conn, and PQfinish().
Referenced by main().
|
static |
Definition at line 200 of file pg_receivewal.c.
References basedir, buf, close, close_destination_dir(), dirent::d_name, fd(), get_destination_dir(), InvalidXLogRecPtr, IsCompressXLogFileName, IsPartialCompressXLogFileName, IsPartialXLogFileName, IsXLogFileName, MAXPGPATH, PG_BINARY, pg_log_error, pg_log_warning, read, readdir(), snprintf, stat::st_size, stat, WalSegSz, XLogFromFileName, and XLogSegNoOffsetToRecPtr.
Referenced by StreamLog().
|
static |
Definition at line 161 of file pg_receivewal.c.
References Assert, basedir, opendir(), and pg_log_error.
Referenced by FindStreamingStart(), and main().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 468 of file pg_receivewal.c.
References _, basedir, close_destination_dir(), compresslevel, conn, connection_string, CreateReplicationSlot(), dbgetpassword, dbhost, dbport, dbuser, disconnect_atexit(), do_create_slot, do_drop_slot, do_sync, DropReplicationSlot(), endpos, fprintf, get_destination_dir(), get_progname(), GetConnection(), getopt_long(), no_argument, noloop, optarg, optind, pg_log_error, pg_log_info, pg_logging_init(), pg_mode_mask, pg_strdup(), PG_TEXTDOMAIN, pg_usleep(), pqsignal(), progname, RECONNECT_SLEEP_TIME, replication_slot, required_argument, RetrieveWalSegSize(), RunIdentifySystem(), set_pglocale_pgservice(), sigint_handler(), slot_exists_ok, standby_message_timeout, StreamLog(), synchronous, time_to_stop, usage(), and verbose.
|
static |
|
static |
Definition at line 110 of file pg_receivewal.c.
References endpos, InvalidXLogRecPtr, LSN_FORMAT_ARGS, pg_log_info, time_to_stop, verbose, and XLogRecPtrIsInvalid.
Referenced by StreamLog().
|
static |
Definition at line 368 of file pg_receivewal.c.
References basedir, CheckServerVersionForStreaming(), compresslevel, conn, CreateWalDirectoryMethod(), StreamCtl::do_sync, do_sync, FindStreamingStart(), WalWriteMethod::finish, FreeWalDirectoryMethod(), GetConnection(), InvalidXLogRecPtr, LSN_FORMAT_ARGS, StreamCtl::mark_done, MemSet, StreamCtl::partial_suffix, pg_free(), pg_log_info, PGINVALID_SOCKET, PQfinish(), ReceiveXlogStream(), replication_slot, StreamCtl::replication_slot, RunIdentifySystem(), StreamCtl::standby_message_timeout, standby_message_timeout, StreamCtl::startpos, StreamCtl::stop_socket, stop_streaming(), StreamCtl::stream_stop, StreamCtl::synchronous, synchronous, StreamCtl::timeline, verbose, StreamCtl::walmethod, WalSegSz, and XLogSegmentOffset.
Referenced by main().
|
static |
Definition at line 75 of file pg_receivewal.c.
References _, printf, progname, and standby_message_timeout.
Referenced by main().
|
static |
Definition at line 34 of file pg_receivewal.c.
Referenced by FindStreamingStart(), get_destination_dir(), main(), and StreamLog().
|
static |
Definition at line 36 of file pg_receivewal.c.
Referenced by main(), and StreamLog().
Definition at line 40 of file pg_receivewal.c.
Referenced by main().
Definition at line 42 of file pg_receivewal.c.
Referenced by main().
Definition at line 43 of file pg_receivewal.c.
Referenced by main(), and StreamLog().
|
static |
Definition at line 46 of file pg_receivewal.c.
Referenced by _PrepParallelRestore(), build_regexp_split_result(), get_next_fragment(), inner_subltree(), main(), mark_fragment(), mark_hl_fragments(), SimpleLruDoesPhysicalPageExist(), and stop_streaming().
|
static |
Definition at line 37 of file pg_receivewal.c.
Referenced by main().
|
static |
Definition at line 45 of file pg_receivewal.c.
Referenced by main(), and StreamLog().
Definition at line 41 of file pg_receivewal.c.
Referenced by main().
|
static |
Definition at line 38 of file pg_receivewal.c.
Referenced by main(), StreamLog(), and usage().
Definition at line 44 of file pg_receivewal.c.
Referenced by main(), and StreamLog().
Definition at line 39 of file pg_receivewal.c.
Referenced by main(), pgarch_MainLoop(), sigint_handler(), and stop_streaming().
|
static |
Definition at line 35 of file pg_receivewal.c.
Referenced by main(), stop_streaming(), and StreamLog().