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)
1602
1602
return true;
1603
1603
}
1604
1604
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
-
1616
1605
/*
1617
1606
* Construct parray containing remapped external directories paths
1618
1607
* from string like /path1:/path2
Original file line number Diff line number Diff line change @@ -200,10 +200,14 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params)
200
200
(parse_program_version (backup -> program_version ) == 20201 )))
201
201
{
202
202
char path [MAXPGPATH ];
203
+ struct stat st ;
203
204
204
205
join_path_components (path , backup -> root_dir , DATABASE_FILE_LIST );
205
206
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 ))
207
211
{
208
212
elog (WARNING , "Backup %s is a victim of metadata corruption. "
209
213
"Additional information can be found here: "
You can’t perform that action at this time.
0 commit comments