|
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/logging.h"#include "libpq-fe.h"#include "libpq/protocol.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 1249 of file receivelog.c.
References fb(), feTimestampDifference(), now(), standby_message_timeout, and still_sending.
Referenced by HandleCopyStream().
|
static |
Definition at line 1224 of file receivelog.c.
References close_walfile(), conn, fb(), 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, fb(), 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, fb(), 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 ProcessWALDataMsg().
Definition at line 884 of file receivelog.c.
References conn, EINTR, fb(), Max, pg_log_error, PGINVALID_SOCKET, PQerrorMessage(), PQsocket(), and select.
Referenced by CopyStreamReceive().
|
static |
Definition at line 946 of file receivelog.c.
References Assert, conn, copybuf, CopyStreamPoll(), fb(), pg_log_error, PQconsumeInput(), PQerrorMessage(), and PQgetCopyData().
Referenced by HandleCopyStream().
Definition at line 258 of file receivelog.c.
References WalWriteMethodOps::existsfile, fb(), MAXFNAMELEN, WalWriteMethod::ops, StreamCtl::timeline, TLHistoryFileName(), and StreamCtl::walmethod.
Referenced by ReceiveXlogStream().
|
static |
Definition at line 751 of file receivelog.c.
References CalculateCopyStreamSleeptime(), CheckCopyStreamStop(), conn, copybuf, CopyStreamReceive(), error(), fb(), feGetCurrentTimestamp(), feTimestampDifferenceExceeds(), GetLastWalMethodError(), HandleEndOfCopyStream(), lastFlushPosition, now(), WalWriteMethod::ops, Walfile::pathname, pg_fatal, pg_log_error, PQfreemem(), PqReplMsg_Keepalive, PqReplMsg_WALData, ProcessKeepaliveMsg(), ProcessWALDataMsg(), 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 1185 of file receivelog.c.
References close_walfile(), conn, fb(), pg_log_error, PGRES_COPY_IN, PQclear, PQerrorMessage(), PQflush(), PQgetResult, PQputCopyEnd(), PQresultStatus, and still_sending.
Referenced by HandleCopyStream().
Definition at line 54 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_NORMAL, fb(), 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, fb(), 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 ProcessWALDataMsg().
|
static |
Definition at line 1000 of file receivelog.c.
References conn, copybuf, fb(), 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 1054 of file receivelog.c.
References close_walfile(), conn, copybuf, Walfile::currpos, fb(), 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 705 of file receivelog.c.
References fb(), pg_log_error, PQgetvalue, PQnfields, PQntuples, and startpos.
Referenced by ReceiveXlogStream().
Definition at line 453 of file receivelog.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), AppendQuotedIdentifier, CheckServerVersionForStreaming(), WalWriteMethodOps::close, CLOSE_NO_RENAME, conn, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), error(), existsTimeLineHistoryFile(), fb(), 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, RunIdentifySystem(), 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, fb(), fe_sendint64(), InvalidXLogRecPtr, lastFlushPosition, len, now(), pg_log_error, PQerrorMessage(), PQflush(), PQputCopyData(), PqReplMsg_StandbyStatusUpdate, and reportFlushPosition.
Referenced by HandleCopyStream(), and ProcessKeepaliveMsg().
Definition at line 275 of file receivelog.c.
References WalWriteMethodOps::close, CLOSE_NORMAL, CLOSE_UNLINK, fb(), 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 ProcessWALDataMsg().
Definition at line 29 of file receivelog.c.
Referenced by CleanupPriorWALFiles(), close_walfile(), HandleCopyStream(), open_walfile(), ProcessKeepaliveMsg(), ProcessWALDataMsg(), and ReceiveXlogStream().