Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc1d1ed

Browse files
author
Artur Zakirov
committed
Change retention purge command finish message
1 parent8f37eb5 commitcc1d1ed

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

‎delete.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ do_delete(time_t backup_id)
3636
/* Get complete list of backups */
3737
backup_list=catalog_get_backup_list(0);
3838
if (!backup_list)
39-
elog(ERROR,"No backup list found, can't process any more.");
39+
elog(ERROR,"no backup list found, can't process any more");
4040

4141
/* Find backup to be deleted */
4242
for (i=0;i<parray_num(backup_list);i++)
@@ -143,7 +143,8 @@ do_retention_purge(void)
143143
time_tdays_threshold=time(NULL)- (retention_window*60*60*24);
144144
XLogRecPtroldest_lsn=InvalidXLogRecPtr;
145145
TimeLineIDoldest_tli;
146-
boolkeep_next_backup= true;/* Do not delete first full backup */
146+
boolkeep_next_backup= true;/* Do not delete first full backup */
147+
boolbackup_deleted= false;/* At least one backup was deleted */
147148

148149
if (retention_redundancy>0)
149150
elog(LOG,"REDUNDANCY=%u",retention_redundancy);
@@ -160,8 +161,7 @@ do_retention_purge(void)
160161
backup_list=catalog_get_backup_list(0);
161162
if (parray_num(backup_list)==0)
162163
{
163-
elog(INFO,"backup list is empty");
164-
elog(INFO,"exit");
164+
elog(INFO,"backup list is empty, purging won't be executed");
165165
return0;
166166
}
167167

@@ -207,6 +207,7 @@ do_retention_purge(void)
207207

208208
/* Delete backup and update status to DELETED */
209209
pgBackupDeleteFiles(backup);
210+
backup_deleted= true;
210211
}
211212

212213
/* Purge WAL files */
@@ -216,7 +217,10 @@ do_retention_purge(void)
216217
parray_walk(backup_list,pgBackupFree);
217218
parray_free(backup_list);
218219

219-
elog(INFO,"purging is finished");
220+
if (backup_deleted)
221+
elog(INFO,"purging finished");
222+
else
223+
elog(INFO,"no one backup was deleted by retention policy");
220224

221225
return0;
222226
}

‎pg_probackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include<time.h>
1717
#include<sys/stat.h>
1818

19-
constchar*PROGRAM_VERSION="1.1.3";
19+
constchar*PROGRAM_VERSION="1.1.4";
2020
constchar*PROGRAM_URL="https://github.com/postgrespro/pg_probackup";
2121
constchar*PROGRAM_EMAIL="https://github.com/postgrespro/pg_probackup/issues";
2222

‎restore.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,10 @@ do_restore(time_t backup_id,
212212
}
213213

214214
/* create recovery.conf */
215-
create_recovery_conf(backup_id,target_time,target_xid,
216-
target_inclusive,base_backup->tli);
215+
dest_backup= (pgBackup*)parray_get(backups,last_diff_index);
216+
if (!dest_backup->stream|| (target_time!=NULL||target_xid!=NULL))
217+
create_recovery_conf(backup_id,target_time,target_xid,
218+
target_inclusive,base_backup->tli);
217219

218220
/* cleanup */
219221
parray_walk(backups,pgBackupFree);

‎tests/expected/option_version.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pg_probackup 1.1.3
1+
pg_probackup 1.1.4

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp