PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <sys/select.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 bool | reportFlushPosition = false |
static XLogRecPtr | lastFlushPosition = InvalidXLogRecPtr |
static bool | still_sending = true |
|
static |
Definition at line 1236 of file receivelog.c.
References feTimestampDifference(), now(), standby_message_timeout, and still_sending.
Referenced by HandleCopyStream().
|
static |
Definition at line 1211 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 375 of file receivelog.c.
References conn, pg_log_error, PQparameterStatus(), and PQserverVersion().
Referenced by BaseBackup(), ReceiveXlogStream(), and StreamLog().
|
static |
Definition at line 192 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_NO_RENAME, CLOSE_NORMAL, Walfile::currpos, fn(), WalWriteMethodOps::get_file_name, GetLastWalMethodError(), lastFlushPosition, StreamCtl::mark_done, mark_file_as_archived(), MAXPGPATH, WalWriteMethod::ops, StreamCtl::partial_suffix, Walfile::pathname, pg_free(), pg_log_error, pg_log_info, strlcpy(), walfile, StreamCtl::walmethod, and WalSegSz.
Referenced by CheckCopyStreamStop(), HandleEndOfCopyStream(), and ProcessXLogDataMsg().
Definition at line 870 of file receivelog.c.
References conn, EINTR, Max, pg_log_error, PGINVALID_SOCKET, PQerrorMessage(), PQsocket(), and select.
Referenced by CopyStreamReceive().
|
static |
Definition at line 932 of file receivelog.c.
References conn, copybuf, CopyStreamPoll(), pg_log_error, PQconsumeInput(), PQerrorMessage(), PQfreemem(), and PQgetCopyData().
Referenced by HandleCopyStream().
Definition at line 258 of file receivelog.c.
References WalWriteMethodOps::existsfile, MAXFNAMELEN, WalWriteMethod::ops, StreamCtl::timeline, TLHistoryFileName(), and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 745 of file receivelog.c.
References CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), conn, copybuf, CopyStreamReceive(), error(), feGetCurrentTimestamp(), feTimestampDifferenceExceeds(), GetLastWalMethodError(), HandleEndOfCopyStream(), lastFlushPosition, now(), WalWriteMethod::ops, Walfile::pathname, pg_fatal, pg_log_error, PQfreemem(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), res, sendFeedback(), StreamCtl::standby_message_timeout, StreamCtl::startpos, still_sending, StreamCtl::stop_socket, WalWriteMethodOps::sync, StreamCtl::synchronous, walfile, and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 1171 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 54 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_NORMAL, GetLastWalMethodError(), MAXPGPATH, WalWriteMethodOps::open_for_write, WalWriteMethod::ops, pg_log_error, snprintf, and StreamCtl::walmethod.
Referenced by close_walfile(), and writeTimeLineHistoryFile().
|
static |
Definition at line 90 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_UNLINK, WalWriteMethod::compression_algorithm, WalWriteMethodOps::existsfile, exit(), fn(), WalWriteMethodOps::get_file_name, WalWriteMethodOps::get_file_size, GetLastWalMethodError(), MAXPGPATH, ngettext, WalWriteMethodOps::open_for_write, WalWriteMethod::ops, StreamCtl::partial_suffix, PG_COMPRESSION_NONE, pg_free(), pg_log_error, WalWriteMethodOps::sync, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, XLByteToSeg, and XLogFileName().
Referenced by ProcessXLogDataMsg().
|
static |
Definition at line 986 of file receivelog.c.
References conn, copybuf, feGetCurrentTimestamp(), GetLastWalMethodError(), lastFlushPosition, len, now(), WalWriteMethod::ops, Walfile::pathname, pg_fatal, pg_log_error, reportFlushPosition, sendFeedback(), still_sending, WalWriteMethodOps::sync, walfile, and StreamCtl::walmethod.
Referenced by HandleCopyStream().
|
static |
Definition at line 1040 of file receivelog.c.
References close_walfile(), conn, copybuf, Walfile::currpos, fe_recvint64(), GetLastWalMethodError(), len, open_walfile(), WalWriteMethod::ops, Walfile::pathname, pg_log_error, PQerrorMessage(), PQflush(), PQputCopyEnd(), still_sending, StreamCtl::stream_stop, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, WalWriteMethodOps::write, and XLogSegmentOffset.
Referenced by HandleCopyStream().
|
static |
Definition at line 699 of file receivelog.c.
References pg_log_error, PQgetvalue(), PQnfields(), PQntuples(), res, and startpos.
Referenced by ReceiveXlogStream().
Definition at line 453 of file receivelog.c.
References CheckServerVersionForStreaming(), WalWriteMethodOps::close, CLOSE_NO_RENAME, conn, error(), existsTimeLineHistoryFile(), GetLastWalMethodError(), HandleCopyStream(), lastFlushPosition, LSN_FORMAT_ARGS, WalWriteMethod::ops, Walfile::pathname, 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 337 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 275 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_NORMAL, CLOSE_UNLINK, filename, GetLastWalMethodError(), StreamCtl::mark_done, mark_file_as_archived(), MAXFNAMELEN, WalWriteMethodOps::open_for_write, WalWriteMethod::ops, pg_log_error, StreamCtl::timeline, TLHistoryFileName(), StreamCtl::walmethod, and WalWriteMethodOps::write.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 31 of file receivelog.c.
Referenced by close_walfile(), HandleCopyStream(), ProcessKeepaliveMsg(), ReceiveXlogStream(), and sendFeedback().
Definition at line 30 of file receivelog.c.
Referenced by ProcessKeepaliveMsg(), ReceiveXlogStream(), and sendFeedback().
Definition at line 33 of file receivelog.c.
Referenced by CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), HandleCopyStream(), HandleEndOfCopyStream(), ProcessKeepaliveMsg(), and ProcessXLogDataMsg().
|
static |
Definition at line 29 of file receivelog.c.
Referenced by CleanupPriorWALFiles(), close_walfile(), HandleCopyStream(), open_walfile(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), and ReceiveXlogStream().