Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c83463

Browse files
committed
Consider DELETING status within merge_backups()
1 parent af340b9 commit 9c83463

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/merge.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ do_merge(time_t backup_id)
8181
/* It is possible that previous merging was interrupted */
8282
backup->status != BACKUP_STATUS_MERGING &&
8383
backup->status != BACKUP_STATUS_DELETING)
84-
elog(ERROR, "Backup %s has status: %s",
85-
base36enc(backup->start_time), status2str(backup->status));
84+
elog(ERROR, "Backup %s has status: %s",
85+
base36enc(backup->start_time), status2str(backup->status));
8686

8787
if (backup->backup_mode == BACKUP_MODE_FULL)
8888
elog(ERROR, "Backup %s is full backup",
@@ -109,10 +109,8 @@ do_merge(time_t backup_id)
109109
if (full_backup->status != BACKUP_STATUS_OK &&
110110
/* It is possible that previous merging was interrupted */
111111
full_backup->status != BACKUP_STATUS_MERGING)
112-
elog(ERROR, "Backup %s has status: %s",
113-
base36enc(full_backup->start_time), status2str(full_backup->status));
114-
115-
//Assert(full_backup_idx != dest_backup_idx);
112+
elog(ERROR, "Backup %s has status: %s",
113+
base36enc(full_backup->start_time), status2str(full_backup->status));
116114

117115
/* form merge list */
118116
while(dest_backup->parent_backup_link)
@@ -122,8 +120,8 @@ do_merge(time_t backup_id)
122120
/* It is possible that previous merging was interrupted */
123121
dest_backup->status != BACKUP_STATUS_MERGING &&
124122
dest_backup->status != BACKUP_STATUS_DELETING)
125-
elog(ERROR, "Backup %s has status: %s",
126-
base36enc(dest_backup->start_time), status2str(dest_backup->status));
123+
elog(ERROR, "Backup %s has status: %s",
124+
base36enc(dest_backup->start_time), status2str(dest_backup->status));
127125

128126
parray_append(merge_list, dest_backup);
129127
dest_backup = dest_backup->parent_backup_link;
@@ -205,7 +203,8 @@ merge_backups(pgBackup *to_backup, pgBackup *from_backup)
205203
* BACKUP_STATUS_MERGING status.
206204
*/
207205
Assert(from_backup->status == BACKUP_STATUS_OK ||
208-
from_backup->status == BACKUP_STATUS_MERGING);
206+
from_backup->status == BACKUP_STATUS_MERGING ||
207+
from_backup->status == BACKUP_STATUS_DELETING);
209208
pgBackupValidate(from_backup);
210209
if (from_backup->status == BACKUP_STATUS_CORRUPT)
211210
elog(ERROR, "Interrupt merging");

0 commit comments

Comments
 (0)