@@ -210,6 +210,7 @@ do_restore_or_validate(time_t target_backup_id,
210
210
/*
211
211
* Validate backups from base_full_backup to dest_backup.
212
212
* And restore if subcommand is RESTORE.
213
+ * TODO what if we found out that backup is not valid?
213
214
*/
214
215
for (i = base_full_backup_index ; i >= dest_backup_index ; i -- )
215
216
{
@@ -270,6 +271,10 @@ restore_backup(pgBackup *backup)
270
271
pthread_t restore_threads [num_threads ];
271
272
restore_files_args * restore_threads_args [num_threads ];
272
273
274
+ if (backup -> status != BACKUP_STATUS_OK )
275
+ elog (ERROR , "Backup %s cannot be restored because it is not valid" ,
276
+ base36enc (backup -> start_time ));
277
+
273
278
/* confirm block size compatibility */
274
279
if (backup -> block_size != BLCKSZ )
275
280
elog (ERROR ,
@@ -541,7 +546,7 @@ restore_directories(const char *pg_data_dir, const char *backup_dir)
541
546
542
547
/*
543
548
* Check that all tablespace mapping entries have correct linked directory
544
- * paths. Linked directories should be empty or do not exist.
549
+ * paths. Linked directories must be empty or do not exist.
545
550
*
546
551
* If tablespace-mapping option is supplied all OLDDIR entries should have
547
552
* entries in tablespace_map file.
@@ -561,7 +566,7 @@ check_tablespace_mapping(pgBackup *backup)
561
566
pgBackupGetPath (backup , backup_path , lengthof (backup_path ), NULL );
562
567
read_tablespace_map (links , backup_path );
563
568
564
- elog (LOG , "check tablespace directories..." );
569
+ elog (LOG , "check tablespace directories of backup %s" , base36enc ( backup -> start_time ) );
565
570
566
571
/* 1 - OLDDIR should has an entry in links */
567
572
for (cell = tablespace_dirs .head ; cell ; cell = cell -> next )
@@ -570,7 +575,7 @@ check_tablespace_mapping(pgBackup *backup)
570
575
571
576
if (parray_bsearch (links , tmp_file , pgFileCompareLinked ) == NULL )
572
577
elog (ERROR , "--tablespace-mapping option's old directory "
573
- "has not an entry in tablespace_map file: \"%s\"" ,
578
+ "doesn't have an entry in tablespace_map file: \"%s\"" ,
574
579
cell -> old_dir );
575
580
}
576
581
0 commit comments