mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-24 08:52:38 +02:00
Change retention purge command finish message
This commit is contained in:
parent
8f37eb5afa
commit
cc1d1edbac
14
delete.c
14
delete.c
@ -36,7 +36,7 @@ do_delete(time_t backup_id)
|
||||
/* Get complete list of backups */
|
||||
backup_list = catalog_get_backup_list(0);
|
||||
if (!backup_list)
|
||||
elog(ERROR, "No backup list found, can't process any more.");
|
||||
elog(ERROR, "no backup list found, can't process any more");
|
||||
|
||||
/* Find backup to be deleted */
|
||||
for (i = 0; i < parray_num(backup_list); i++)
|
||||
@ -143,7 +143,8 @@ do_retention_purge(void)
|
||||
time_t days_threshold = time(NULL) - (retention_window * 60 * 60 * 24);
|
||||
XLogRecPtr oldest_lsn = InvalidXLogRecPtr;
|
||||
TimeLineID oldest_tli;
|
||||
bool keep_next_backup = true; /* Do not delete first full backup */
|
||||
bool keep_next_backup = true; /* Do not delete first full backup */
|
||||
bool backup_deleted = false; /* At least one backup was deleted */
|
||||
|
||||
if (retention_redundancy > 0)
|
||||
elog(LOG, "REDUNDANCY=%u", retention_redundancy);
|
||||
@ -160,8 +161,7 @@ do_retention_purge(void)
|
||||
backup_list = catalog_get_backup_list(0);
|
||||
if (parray_num(backup_list) == 0)
|
||||
{
|
||||
elog(INFO, "backup list is empty");
|
||||
elog(INFO, "exit");
|
||||
elog(INFO, "backup list is empty, purging won't be executed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -207,6 +207,7 @@ do_retention_purge(void)
|
||||
|
||||
/* Delete backup and update status to DELETED */
|
||||
pgBackupDeleteFiles(backup);
|
||||
backup_deleted = true;
|
||||
}
|
||||
|
||||
/* Purge WAL files */
|
||||
@ -216,7 +217,10 @@ do_retention_purge(void)
|
||||
parray_walk(backup_list, pgBackupFree);
|
||||
parray_free(backup_list);
|
||||
|
||||
elog(INFO, "purging is finished");
|
||||
if (backup_deleted)
|
||||
elog(INFO, "purging finished");
|
||||
else
|
||||
elog(INFO, "no one backup was deleted by retention policy");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
const char *PROGRAM_VERSION = "1.1.3";
|
||||
const char *PROGRAM_VERSION = "1.1.4";
|
||||
const char *PROGRAM_URL = "https://github.com/postgrespro/pg_probackup";
|
||||
const char *PROGRAM_EMAIL = "https://github.com/postgrespro/pg_probackup/issues";
|
||||
|
||||
|
@ -212,8 +212,10 @@ base_backup_found:
|
||||
}
|
||||
|
||||
/* create recovery.conf */
|
||||
create_recovery_conf(backup_id, target_time, target_xid,
|
||||
target_inclusive, base_backup->tli);
|
||||
dest_backup = (pgBackup *) parray_get(backups, last_diff_index);
|
||||
if (!dest_backup->stream || (target_time != NULL || target_xid != NULL))
|
||||
create_recovery_conf(backup_id, target_time, target_xid,
|
||||
target_inclusive, base_backup->tli);
|
||||
|
||||
/* cleanup */
|
||||
parray_walk(backups, pgBackupFree);
|
||||
|
@ -1 +1 @@
|
||||
pg_probackup 1.1.3
|
||||
pg_probackup 1.1.4
|
||||
|
Loading…
Reference in New Issue
Block a user