Definition at line 1745 of file snapbuild.c.
1747{
1752
1753 sprintf(path,
"%s/%X-%X.snap",
1756
1758
1760 {
1762 return false;
1763
1766 errmsg(
"could not open file \"%s\": %m", path)));
1767 }
1768
1769
1770
1771
1772
1773
1774
1775
1776
1779
1780
1782
1786 errmsg(
"snapbuild state file \"%s\" has wrong magic number: %u instead of %u",
1788
1792 errmsg(
"snapbuild state file \"%s\" has unsupported version: %u instead of %u",
1794
1799
1800
1803
1804
1806 {
1811 }
1812
1813
1815 {
1820 }
1821
1825 errmsg(
"could not close file \"%s\": %m", path)));
1826
1828
1829
1833 errmsg(
"checksum mismatch for snapbuild state file \"%s\": is %u, should be %u",
1834 path, checksum, ondisk->
checksum)));
1835
1836 return true;
1837}
int errcode_for_file_access(void)
int errcode(int sqlerrcode)
#define ereport(elevel,...)
int CloseTransientFile(int fd)
void fsync_fname(const char *fname, bool isdir)
int OpenTransientFile(const char *fileName, int fileFlags)
void * MemoryContextAllocZero(MemoryContext context, Size size)
#define ERRCODE_DATA_CORRUPTED
#define COMP_CRC32C(crc, data, len)
#define EQ_CRC32C(c1, c2)
static int fd(const char *x, int i)
#define PG_LOGICAL_SNAPSHOTS_DIR
#define SNAPBUILD_VERSION
#define SnapBuildOnDiskNotChecksummedSize
#define SnapBuildOnDiskConstantSize
static void SnapBuildRestoreContents(int fd, void *dest, Size size, const char *path)
struct SnapBuild::@123 committed
struct SnapBuild::@124 catchange
#define LSN_FORMAT_ARGS(lsn)
References SnapBuildOnDisk::builder, SnapBuild::catchange, SnapBuildOnDisk::checksum, CloseTransientFile(), SnapBuild::committed, COMP_CRC32C, EQ_CRC32C, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errcode_for_file_access(), errmsg, ERROR, fb(), fd(), FIN_CRC32C, fsync_fname(), INIT_CRC32C, LSN_FORMAT_ARGS, SnapBuildOnDisk::magic, MAXPGPATH, MemoryContextAllocZero(), OpenTransientFile(), PG_BINARY, PG_LOGICAL_SNAPSHOTS_DIR, SNAPBUILD_MAGIC, SNAPBUILD_VERSION, SnapBuildOnDiskConstantSize, SnapBuildOnDiskNotChecksummedSize, SnapBuildRestoreContents(), sprintf, SnapBuildOnDisk::version, SnapBuild::xcnt, and SnapBuild::xip.
Referenced by pg_get_logical_snapshot_info(), pg_get_logical_snapshot_meta(), and SnapBuildRestore().