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 1230 of file receivelog.c.
References feTimestampDifference(), and still_sending.
Referenced by HandleCopyStream().
|
static |
Definition at line 1205 of file receivelog.c.
References close_walfile(), pg_log_error, PQerrorMessage(), PQflush(), PQputCopyEnd(), still_sending, StreamCtl::stream_stop, and StreamCtl::timeline.
Referenced by HandleCopyStream().
Definition at line 357 of file receivelog.c.
References pg_log_error, PQparameterStatus(), and PQserverVersion().
Referenced by BaseBackup(), ReceiveXlogStream(), and StreamLog().
|
static |
Definition at line 177 of file receivelog.c.
References WalWriteMethod::close, CLOSE_NO_RENAME, CLOSE_NORMAL, CLOSE_UNLINK, current_walfile_name, WalWriteMethod::get_current_pos, WalWriteMethod::getlasterror, lastFlushPosition, StreamCtl::mark_done, mark_file_as_archived(), StreamCtl::partial_suffix, pg_log_error, pg_log_info, walfile, StreamCtl::walmethod, and WalSegSz.
Referenced by CheckCopyStreamStop(), HandleEndOfCopyStream(), and ProcessXLogDataMsg().
Definition at line 860 of file receivelog.c.
References EINTR, Max, pg_log_error, PGINVALID_SOCKET, PQerrorMessage(), PQsocket(), and select.
Referenced by CopyStreamReceive().
|
static |
Definition at line 922 of file receivelog.c.
References copybuf, CopyStreamPoll(), pg_log_error, PQconsumeInput(), PQerrorMessage(), PQfreemem(), and PQgetCopyData().
Referenced by HandleCopyStream().
Definition at line 241 of file receivelog.c.
References WalWriteMethod::existsfile, MAXFNAMELEN, StreamCtl::timeline, TLHistoryFileName, and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 731 of file receivelog.c.
References CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), copybuf, CopyStreamReceive(), current_walfile_name, error(), feGetCurrentTimestamp(), feTimestampDifferenceExceeds(), WalWriteMethod::getlasterror, HandleEndOfCopyStream(), lastFlushPosition, now(), pg_log_error, pg_log_fatal, PQfreemem(), ProcessKeepaliveMsg(), ProcessXLogDataMsg(), 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 1164 of file receivelog.c.
References close_walfile(), pg_log_error, PGRES_COPY_IN, PQclear(), PQerrorMessage(), PQflush(), PQfreemem(), PQgetResult(), PQputCopyEnd(), PQresultStatus(), 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 88 of file receivelog.c.
References WalWriteMethod::close, CLOSE_UNLINK, current_walfile_name, WalWriteMethod::existsfile, fn(), WalWriteMethod::get_file_size, WalWriteMethod::getlasterror, MAXPGPATH, ngettext, WalWriteMethod::open_for_write, StreamCtl::partial_suffix, pg_log_error, pg_log_fatal, snprintf, WalWriteMethod::sync, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, XLByteToSeg, and XLogFileName.
Referenced by ProcessXLogDataMsg().
|
static |
Definition at line 977 of file receivelog.c.
References current_walfile_name, feGetCurrentTimestamp(), WalWriteMethod::getlasterror, lastFlushPosition, now(), pg_log_error, pg_log_fatal, reportFlushPosition, sendFeedback(), still_sending, WalWriteMethod::sync, walfile, and StreamCtl::walmethod.
Referenced by HandleCopyStream().
|
static |
Definition at line 1034 of file receivelog.c.
References close_walfile(), current_walfile_name, fe_recvint64(), WalWriteMethod::get_current_pos, WalWriteMethod::getlasterror, 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 685 of file receivelog.c.
References pg_log_error, PQgetvalue(), PQnfields(), and PQntuples().
Referenced by ReceiveXlogStream().
Definition at line 435 of file receivelog.c.
References CheckServerVersionForStreaming(), WalWriteMethod::close, CLOSE_NO_RENAME, current_walfile_name, error(), existsTimeLineHistoryFile(), WalWriteMethod::getlasterror, HandleCopyStream(), lastFlushPosition, LSN_FORMAT_ARGS, pg_log_error, pg_log_warning, PGRES_COMMAND_OK, PGRES_COPY_BOTH, PGRES_TUPLES_OK, PQclear(), PQerrorMessage(), PQexec(), PQgetResult(), PQgetvalue(), PQnfields(), PQntuples(), PQresultErrorMessage(), PQresultStatus(), ReadEndOfStreamingResult(), StreamCtl::replication_slot, reportFlushPosition, 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 319 of file receivelog.c.
References fe_sendint64(), InvalidXLogRecPtr, lastFlushPosition, pg_log_error, PQerrorMessage(), PQflush(), PQputCopyData(), and reportFlushPosition.
Referenced by HandleCopyStream(), and ProcessKeepaliveMsg().
Definition at line 258 of file receivelog.c.
References WalWriteMethod::close, CLOSE_NORMAL, CLOSE_UNLINK, 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().