#include "postgres_fe.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/logging.h"
#include "pgtar.h"
#include "walmethods.h"
Go to the source code of this file.
Definition at line 98 of file walmethods.c.
Definition at line 36 of file walmethods.c.
Definition at line 33 of file walmethods.c.
Definition at line 640 of file walmethods.c.
References DirectoryMethodData::base, basedir, DirectoryMethodData::basedir, clear_error, compression_algorithm, WalWriteMethod::compression_algorithm, WalWriteMethod::compression_level, WalWriteMethod::ops, pg_malloc0(), pg_strdup(), WalWriteMethod::sync, and WalDirectoryMethodOps.
Referenced by LogStreamerMain(), and StreamLog().
Definition at line 1355 of file walmethods.c.
References TarMethodData::base, clear_error, compression_algorithm, WalWriteMethod::compression_algorithm, WalWriteMethod::compression_level, TarMethodData::fd, WalWriteMethod::ops, PG_COMPRESSION_GZIP, pg_malloc(), pg_malloc0(), sprintf, WalWriteMethod::sync, TarMethodData::tarfilename, WalTarMethodOps, and ZLIB_OUT_SIZE.
Referenced by LogStreamerMain().
Definition at line 385 of file walmethods.c.
References Assert(), DirectoryMethodFile::base, DirectoryMethodData::basedir, clear_error, close, CLOSE_NORMAL, CLOSE_UNLINK, WalWriteMethod::compression_algorithm, dir_get_file_name(), durable_rename(), DirectoryMethodFile::fd, filename, fsync_fname(), fsync_parent_path(), DirectoryMethodFile::fullpath, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, MAXPGPATH, Walfile::pathname, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, pg_free(), pg_log_error, snprintf, WalWriteMethod::sync, DirectoryMethodFile::temp_suffix, write, and Walfile::wwmethod.
Definition at line 584 of file walmethods.c.
References DirectoryMethodData::basedir, clear_error, close, fd(), MAXPGPATH, PG_BINARY, and snprintf.
Definition at line 608 of file walmethods.c.
References DirectoryMethodData::basedir, clear_error, fsync_fname(), WalWriteMethod::lasterrno, and WalWriteMethod::sync.
Definition at line 630 of file walmethods.c.
References DirectoryMethodData::basedir, and pg_free().
Definition at line 102 of file walmethods.c.
References WalWriteMethod::compression_algorithm, filename, MAXPGPATH, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, pg_malloc0(), and snprintf.
Referenced by dir_close(), and dir_open_for_write().
Definition at line 565 of file walmethods.c.
References DirectoryMethodData::basedir, WalWriteMethod::lasterrno, MAXPGPATH, snprintf, stat::st_size, and stat.
Definition at line 117 of file walmethods.c.
References DirectoryMethodFile::base, DirectoryMethodData::basedir, clear_error, close, WalWriteMethod::compression_algorithm, WalWriteMethod::compression_level, Walfile::currpos, dir_get_file_name(), DirectoryMethodFile::fd, fd(), filename, fsync_fname(), fsync_parent_path(), DirectoryMethodFile::fullpath, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, LZ4_IN_SIZE, MAXPGPATH, Walfile::pathname, PG_BINARY, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, PG_COMPRESSION_NONE, pg_file_create_mode, pg_free(), pg_malloc0(), pg_pwrite_zeros(), pg_strdup(), snprintf, WalWriteMethod::sync, DirectoryMethodFile::temp_suffix, write, and Walfile::wwmethod.
Definition at line 514 of file walmethods.c.
References Assert(), clear_error, WalWriteMethod::compression_algorithm, DirectoryMethodFile::fd, fd(), fsync, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, WalWriteMethod::sync, write, and Walfile::wwmethod.
Definition at line 304 of file walmethods.c.
References Assert(), DirectoryMethodFile::base, buf, clear_error, WalWriteMethod::compression_algorithm, Walfile::currpos, DirectoryMethodFile::fd, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, LZ4_IN_SIZE, PG_COMPRESSION_GZIP, PG_COMPRESSION_LZ4, remaining, write, and Walfile::wwmethod.
Definition at line 1383 of file walmethods.c.
References WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, and strerror.
Referenced by close_walfile(), HandleCopyStream(), mark_file_as_archived(), open_walfile(), ProcessKeepaliveMsg(), ProcessWALDataMsg(), ReceiveXlogStream(), tar_close(), and writeTimeLineHistoryFile().
Definition at line 1042 of file walmethods.c.
References _, Assert(), clear_error, CLOSE_NORMAL, CLOSE_UNLINK, WalWriteMethod::compression_algorithm, WalWriteMethod::compression_level, TarMethodData::currentfile, Walfile::currpos, TarMethodData::fd, GetLastWalMethodError(), TarMethodFile::header, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, TarMethodFile::pad_to_size, PG_COMPRESSION_GZIP, PG_COMPRESSION_NONE, pg_fatal, pg_free(), print_tar_number(), strlcpy(), TAR_BLOCK_SIZE, TAR_OFFSET_CHECKSUM, TAR_OFFSET_NAME, TAR_OFFSET_SIZE, tar_sync(), tar_write(), tar_write_padding_data(), tarChecksum(), tarPaddingBytesRequired(), write, and Walfile::wwmethod.
Referenced by tar_finish().
Definition at line 1219 of file walmethods.c.
References clear_error.
Definition at line 1227 of file walmethods.c.
References _, Assert(), TarMethodFile::base, clear_error, close, CLOSE_NORMAL, WalWriteMethod::compression_algorithm, TarMethodData::currentfile, TarMethodData::fd, fsync, fsync_fname(), fsync_parent_path(), WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, len, PG_COMPRESSION_GZIP, PG_COMPRESSION_NONE, WalWriteMethod::sync, tar_close(), TarMethodData::tarfilename, write, and ZLIB_OUT_SIZE.
Definition at line 1336 of file walmethods.c.
References WalWriteMethod::compression_algorithm, PG_COMPRESSION_GZIP, pg_free(), and TarMethodData::tarfilename.
Definition at line 825 of file walmethods.c.
References filename, MAXPGPATH, pg_malloc0(), and snprintf.
Referenced by tar_open_for_write().
Definition at line 1007 of file walmethods.c.
References clear_error, and WalWriteMethod::lasterrno.
Definition at line 837 of file walmethods.c.
References _, Assert(), TarMethodFile::base, clear_error, WalWriteMethod::compression_algorithm, WalWriteMethod::compression_level, TarMethodData::currentfile, Walfile::currpos, TarMethodData::fd, TarMethodFile::header, WalWriteMethod::lasterrno, WalWriteMethod::lasterrstring, TarMethodFile::ofs_start, TarMethodFile::pad_to_size, Walfile::pathname, PG_BINARY, PG_COMPRESSION_GZIP, PG_COMPRESSION_NONE, pg_file_create_mode, pg_free(), pg_malloc(), pg_malloc0(), pg_strdup(), S_IRUSR, S_IWUSR, TAR_BLOCK_SIZE, tar_get_file_name(), TAR_OK, tar_write_padding_data(), tarCreateHeader(), TarMethodData::tarfilename, write, Walfile::wwmethod, and ZLIB_OUT_SIZE.
Definition at line 1017 of file walmethods.c.
References Assert(), clear_error, WalWriteMethod::compression_algorithm, TarMethodData::fd, fsync, WalWriteMethod::lasterrno, PG_COMPRESSION_NONE, WalWriteMethod::sync, and Walfile::wwmethod.
Referenced by tar_close().
Definition at line 765 of file walmethods.c.
References Assert(), buf, clear_error, WalWriteMethod::compression_algorithm, Walfile::currpos, TarMethodData::fd, WalWriteMethod::lasterrno, PG_COMPRESSION_GZIP, PG_COMPRESSION_NONE, write, and Walfile::wwmethod.
Referenced by tar_close(), and tar_write_padding_data().
Definition at line 805 of file walmethods.c.
References TarMethodFile::base, PGAlignedXLogBlock::data, Min, and tar_write().
Referenced by tar_close(), and tar_open_for_write().
Definition at line 58 of file walmethods.c.
Referenced by CreateWalDirectoryMethod().
Definition at line 679 of file walmethods.c.
Referenced by CreateWalTarMethod().