You've already forked pg_probackup
							
							
				mirror of
				https://github.com/postgrespro/pg_probackup.git
				synced 2025-10-31 00:17:52 +02:00 
			
		
		
		
	fix dest backup search
This commit is contained in:
		
							
								
								
									
										1
									
								
								backup.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								backup.c
									
									
									
									
									
								
							| @@ -876,6 +876,7 @@ pg_stop_backup(pgBackup *backup) | ||||
| 		fwrite(PQgetvalue(res, 0, 1), 1, strlen(PQgetvalue(res, 0, 1)), fp); | ||||
| 		fclose(fp); | ||||
|  | ||||
| 		/* TODO What for do we save the file into backup_list? */ | ||||
| 		file = pgFileNew(backup_label, true); | ||||
| 		calc_file_checksum(file); | ||||
| 		free(file->path); | ||||
|   | ||||
							
								
								
									
										10
									
								
								data.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								data.c
									
									
									
									
									
								
							| @@ -319,7 +319,7 @@ restore_file_partly(const char *from_root,const char *to_root, pgFile *file) | ||||
| 	int			errno_tmp; | ||||
| 	struct stat	st; | ||||
| 	char		to_path[MAXPGPATH]; | ||||
| 	char		buf[8192]; | ||||
| 	char		buf[BLCKSZ]; | ||||
| 	size_t write_size = 0; | ||||
|  | ||||
| 	join_path_components(to_path, to_root, file->path + strlen(from_root) + 1); | ||||
| @@ -562,7 +562,6 @@ is_compressed_data_file(pgFile *file) | ||||
| } | ||||
|  | ||||
| /* | ||||
|  * TODO Don't use buffer. | ||||
|  * Add check that file is not bigger than RELSEG_SIZE. | ||||
|  * WARNING compressed file can be exceed this limit. | ||||
|  * Add compression. | ||||
| @@ -575,7 +574,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file) | ||||
| 	FILE	   *out; | ||||
| 	size_t		read_len = 0; | ||||
| 	int			errno_tmp; | ||||
| 	char		buf[8192]; | ||||
| 	char		buf[BLCKSZ]; | ||||
| 	struct stat	st; | ||||
| 	pg_crc32	crc; | ||||
|  | ||||
| @@ -705,7 +704,7 @@ copy_file_partly(const char *from_root, const char *to_root, | ||||
| 	size_t		read_len = 0; | ||||
| 	int			errno_tmp; | ||||
| 	struct stat	st; | ||||
| 	char		buf[8192]; | ||||
| 	char		buf[BLCKSZ]; | ||||
|  | ||||
| 	/* reset size summary */ | ||||
| 	file->read_size = 0; | ||||
| @@ -823,7 +822,6 @@ copy_file_partly(const char *from_root, const char *to_root, | ||||
|  * Calculate checksum of various files which are not copied from PGDATA, | ||||
|  * but created in process of backup, such as stream XLOG files, | ||||
|  * PG_TABLESPACE_MAP_FILE and PG_BACKUP_LABEL_FILE. | ||||
|  * TODO Why do we read them into a buffer of blocksize? | ||||
|  */ | ||||
| bool | ||||
| calc_file_checksum(pgFile *file) | ||||
| @@ -831,7 +829,7 @@ calc_file_checksum(pgFile *file) | ||||
| 	FILE	   *in; | ||||
| 	size_t		read_len = 0; | ||||
| 	int			errno_tmp; | ||||
| 	char		buf[8192]; | ||||
| 	char		buf[BLCKSZ]; | ||||
| 	struct stat	st; | ||||
| 	pg_crc32	crc; | ||||
|  | ||||
|   | ||||
| @@ -135,8 +135,9 @@ do_restore_or_validate(time_t target_backup_id, | ||||
| 		 * We found target backup. Check its status and | ||||
| 		 * ensure that it satisfies recovery target. | ||||
| 		 */ | ||||
| 		if (target_backup_id == current_backup->start_time | ||||
| 		if ((target_backup_id == current_backup->start_time | ||||
| 			|| target_backup_id == INVALID_BACKUP_ID) | ||||
| 			&& !dest_backup) | ||||
| 		{ | ||||
| 			if (current_backup->status != BACKUP_STATUS_OK) | ||||
| 				elog(ERROR, "given backup %s is in %s status", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user