File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -1602,17 +1602,6 @@ fileExists(const char *path, fio_location location)
16021602 return true;
16031603}
16041604
1605- size_t
1606- pgFileSize (const char * path )
1607- {
1608- struct stat buf ;
1609-
1610- if (stat (path , & buf ) == -1 )
1611- elog (ERROR , "Cannot stat file \"%s\": %s" , path , strerror (errno ));
1612-
1613- return buf .st_size ;
1614- }
1615-
16161605/*
16171606 * Construct parray containing remapped external directories paths
16181607 * from string like /path1:/path2
Original file line number Diff line number Diff line change @@ -200,10 +200,14 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
200200 (parse_program_version (backup -> program_version ) == 20201 )))
201201 {
202202 char path [MAXPGPATH ];
203+ struct stat st ;
203204
204205 join_path_components (path , backup -> root_dir , DATABASE_FILE_LIST );
205206
206- if (pgFileSize (path ) >= (BLCKSZ * 500 ))
207+ if (fio_stat (FIO_BACKUP_HOST , path , & st , true) < 0 )
208+ elog (ERROR , "Cannot stat file \"%s\": %s" , path , strerror (errno ));
209+
210+ if (st .st_size >= (BLCKSZ * 500 ))
207211 {
208212 elog (WARNING , "Backup %s is a victim of metadata corruption. "
209213 "Additional information can be found here: "
You can’t perform that action at this time.
0 commit comments