Definition at line 105 of file load_manifest.c.
106{
113 char *buffer;
114 int rc;
118
119
122 {
124 {
127 }
128 pg_fatal(
"could not open file \"%s\": %m", pathname);
129 }
130
131
133 pg_fatal(
"could not stat file \"%s\": %m", pathname);
134
135
138
139
141
150
151
152
153
154 if (
statbuf.st_size <= chunk_size)
155 {
159 {
160 if (rc < 0)
161 pg_fatal(
"could not read file \"%s\": %m", pathname);
162 else
163 pg_fatal(
"could not read file \"%s\": read %d of %lld",
164 pathname, rc, (
long long int)
statbuf.st_size);
165 }
166
167
169
170
172 }
173 else
174 {
177
179
181
183 {
185
186
187
188
189
190
197 {
198 if (rc < 0)
199 pg_fatal(
"could not read file \"%s\": %m", pathname);
200 else
201 pg_fatal(
"could not read file \"%s\": read %lld of %lld",
202 pathname,
204 (
long long int)
statbuf.st_size);
205 }
208 }
209
210
212
214 }
215
216
218 return result;
219}
void * pg_malloc(size_t size)
#define pg_malloc0_object(type)
#define ESTIMATED_BYTES_PER_MANIFEST_LINE
static void combinebackup_per_file_cb(JsonManifestParseContext *context, const char *pathname, uint64 size, pg_checksum_type checksum_type, int checksum_length, uint8 *checksum_payload)
static pg_noreturn void report_manifest_error(JsonManifestParseContext *context, const char *fmt,...) pg_attribute_printf(2
static void combinebackup_version_cb(JsonManifestParseContext *context, int manifest_version)
static void combinebackup_per_wal_range_cb(JsonManifestParseContext *context, TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
static void combinebackup_system_identifier_cb(JsonManifestParseContext *context, uint64 manifest_system_identifier)
void pfree(void *pointer)
void json_parse_manifest(JsonManifestParseContext *context, const char *buffer, size_t size)
JsonManifestParseIncrementalState * json_parse_manifest_incremental_init(JsonManifestParseContext *context)
void json_parse_manifest_incremental_shutdown(JsonManifestParseIncrementalState *incstate)
void json_parse_manifest_incremental_chunk(JsonManifestParseIncrementalState *incstate, const char *chunk, size_t size, bool is_last)
#define pg_log_warning(...)
static int fd(const char *x, int i)
json_manifest_per_wal_range_callback per_wal_range_cb
json_manifest_system_identifier_callback system_identifier_cb
json_manifest_error_callback error_cb
json_manifest_per_file_callback per_file_cb
json_manifest_version_callback version_cb
manifest_files_hash * files
References close, combinebackup_per_file_cb(), combinebackup_per_wal_range_cb(), combinebackup_system_identifier_cb(), combinebackup_version_cb(), JsonManifestParseContext::error_cb, ESTIMATED_BYTES_PER_MANIFEST_LINE, fb(), fd(), manifest_data::files, fstat, json_parse_manifest(), json_parse_manifest_incremental_chunk(), json_parse_manifest_incremental_init(), json_parse_manifest_incremental_shutdown(), Max, MAXPGPATH, Min, JsonManifestParseContext::per_file_cb, JsonManifestParseContext::per_wal_range_cb, pfree(), PG_BINARY, pg_fatal, pg_log_warning, pg_malloc(), pg_malloc0_object, PG_UINT32_MAX, JsonManifestParseContext::private_data, read, READ_CHUNK_SIZE, report_manifest_error(), snprintf, JsonManifestParseContext::system_identifier_cb, and JsonManifestParseContext::version_cb.
Referenced by load_backup_manifests().