PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <sys/stat.h>
#include <unistd.h>
#include "access/xlog_internal.h"
#include "common/file_utils.h"
#include "common/logging.h"
#include "libpq-fe.h"
#include "receivelog.h"
#include "streamutil.h"
Go to the source code of this file.
Variables | |
static Walfile * | walfile = NULL |
static char | current_walfile_name [MAXPGPATH] = "" |
static bool | reportFlushPosition = false |
static XLogRecPtr | lastFlushPosition = InvalidXLogRecPtr |
static bool | still_sending = true |
|
static |
Definition at line 1244 of file receivelog.c.
References feTimestampDifference(), now(), standby_message_timeout, and still_sending.
Referenced by HandleCopyStream().
|
static |
Definition at line 1219 of file receivelog.c.
References close_walfile(), conn, pg_log_error, PQerrorMessage(), PQflush(), PQputCopyEnd(), still_sending, StreamCtl::stream_stop, and StreamCtl::timeline.
Referenced by HandleCopyStream().
Definition at line 381 of file receivelog.c.
References conn, pg_log_error, PQparameterStatus(), and PQserverVersion().
Referenced by BaseBackup(), ReceiveXlogStream(), and StreamLog().
|
static |
Definition at line 191 of file receivelog.c.
References WalWriteMethod::close, CLOSE_NO_RENAME, CLOSE_NORMAL, CLOSE_UNLINK, current_walfile_name, fn(), WalWriteMethod::get_current_pos, WalWriteMethod::get_file_name, WalWriteMethod::getlasterror, lastFlushPosition, StreamCtl::mark_done, mark_file_as_archived(), StreamCtl::partial_suffix, pg_free(), pg_log_error, pg_log_info, walfile, StreamCtl::walmethod, and WalSegSz.
Referenced by CheckCopyStreamStop(), HandleEndOfCopyStream(), and ProcessXLogDataMsg().
Definition at line 877 of file receivelog.c.
References conn, EINTR, Max, pg_log_error, PGINVALID_SOCKET, PQerrorMessage(), PQsocket(), and select.
Referenced by CopyStreamReceive().
|
static |
Definition at line 939 of file receivelog.c.
References conn, copybuf, CopyStreamPoll(), pg_log_error, PQconsumeInput(), PQerrorMessage(), PQfreemem(), and PQgetCopyData().
Referenced by HandleCopyStream().
Definition at line 265 of file receivelog.c.
References WalWriteMethod::existsfile, MAXFNAMELEN, StreamCtl::timeline, TLHistoryFileName, and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 751 of file receivelog.c.
References CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), conn, copybuf, CopyStreamReceive(), current_walfile_name, error(), feGetCurrentTimestamp(), feTimestampDifferenceExceeds(), WalWriteMethod::getlasterror, HandleEndOfCopyStream(), lastFlushPosition, now(), pg_fatal, pg_log_error, PQfreemem(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), res, sendFeedback(), StreamCtl::standby_message_timeout, StreamCtl::startpos, still_sending, StreamCtl::stop_socket, WalWriteMethod::sync, StreamCtl::synchronous, walfile, and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 1178 of file receivelog.c.
References close_walfile(), conn, copybuf, pg_log_error, PGRES_COPY_IN, PQclear(), PQerrorMessage(), PQflush(), PQfreemem(), PQgetResult(), PQputCopyEnd(), PQresultStatus(), res, and still_sending.
Referenced by HandleCopyStream().
Definition at line 57 of file receivelog.c.
References WalWriteMethod::close, CLOSE_NORMAL, WalWriteMethod::getlasterror, MAXPGPATH, WalWriteMethod::open_for_write, pg_log_error, snprintf, and StreamCtl::walmethod.
Referenced by close_walfile(), and writeTimeLineHistoryFile().
|
static |
Definition at line 93 of file receivelog.c.
References WalWriteMethod::close, CLOSE_UNLINK, WalWriteMethod::compression_algorithm, current_walfile_name, WalWriteMethod::existsfile, exit(), fn(), WalWriteMethod::get_file_name, WalWriteMethod::get_file_size, WalWriteMethod::getlasterror, ngettext, WalWriteMethod::open_for_write, StreamCtl::partial_suffix, PG_COMPRESSION_NONE, pg_free(), pg_log_error, WalWriteMethod::sync, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, XLByteToSeg, and XLogFileName.
Referenced by ProcessXLogDataMsg().
|
static |
Definition at line 994 of file receivelog.c.
References conn, copybuf, current_walfile_name, feGetCurrentTimestamp(), WalWriteMethod::getlasterror, lastFlushPosition, len, now(), pg_fatal, pg_log_error, reportFlushPosition, sendFeedback(), still_sending, WalWriteMethod::sync, walfile, and StreamCtl::walmethod.
Referenced by HandleCopyStream().
|
static |
Definition at line 1048 of file receivelog.c.
References close_walfile(), conn, copybuf, current_walfile_name, fe_recvint64(), WalWriteMethod::get_current_pos, WalWriteMethod::getlasterror, len, open_walfile(), pg_log_error, PQerrorMessage(), PQflush(), PQputCopyEnd(), still_sending, StreamCtl::stream_stop, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, WalWriteMethod::write, and XLogSegmentOffset.
Referenced by HandleCopyStream().
|
static |
Definition at line 705 of file receivelog.c.
References pg_log_error, PQgetvalue(), PQnfields(), PQntuples(), res, and startpos.
Referenced by ReceiveXlogStream().
Definition at line 459 of file receivelog.c.
References CheckServerVersionForStreaming(), WalWriteMethod::close, CLOSE_NO_RENAME, conn, current_walfile_name, error(), existsTimeLineHistoryFile(), WalWriteMethod::getlasterror, HandleCopyStream(), lastFlushPosition, LSN_FORMAT_ARGS, pg_free(), pg_log_error, pg_log_warning, PGRES_COMMAND_OK, PGRES_COPY_BOTH, PGRES_TUPLES_OK, PQclear(), PQexec(), PQgetResult(), PQgetvalue(), PQnfields(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), ReadEndOfStreamingResult(), StreamCtl::replication_slot, reportFlushPosition, res, RunIdentifySystem(), snprintf, sprintf, StreamCtl::startpos, StreamCtl::stream_stop, StreamCtl::synchronous, StreamCtl::sysidentifier, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, writeTimeLineHistoryFile(), and XLogSegmentOffset.
Referenced by LogStreamerMain(), and StreamLog().
|
static |
Definition at line 343 of file receivelog.c.
References conn, fe_sendint64(), InvalidXLogRecPtr, lastFlushPosition, len, now(), pg_log_error, PQerrorMessage(), PQflush(), PQputCopyData(), and reportFlushPosition.
Referenced by HandleCopyStream(), and ProcessKeepaliveMsg().
Definition at line 282 of file receivelog.c.
References WalWriteMethod::close, CLOSE_NORMAL, CLOSE_UNLINK, filename, WalWriteMethod::getlasterror, StreamCtl::mark_done, mark_file_as_archived(), MAXFNAMELEN, WalWriteMethod::open_for_write, pg_log_error, StreamCtl::timeline, TLHistoryFileName, StreamCtl::walmethod, and WalWriteMethod::write.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 32 of file receivelog.c.
Referenced by close_walfile(), HandleCopyStream(), open_walfile(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), and ReceiveXlogStream().
|
static |
Definition at line 34 of file receivelog.c.
Referenced by close_walfile(), HandleCopyStream(), ProcessKeepaliveMsg(), ReceiveXlogStream(), and sendFeedback().
Definition at line 33 of file receivelog.c.
Referenced by ProcessKeepaliveMsg(), ReceiveXlogStream(), and sendFeedback().
Definition at line 36 of file receivelog.c.
Referenced by CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), HandleCopyStream(), HandleEndOfCopyStream(), ProcessKeepaliveMsg(), and ProcessXLogDataMsg().
|
static |
Definition at line 31 of file receivelog.c.
Referenced by CleanupPriorWALFiles(), close_walfile(), HandleCopyStream(), open_walfile(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), and ReceiveXlogStream().