1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-25 09:01:48 +02:00

[Issue #140] report correctly the total size of data to delete during backup and WAL retention purge

This commit is contained in:
Grigory Smolkin 2019-10-31 13:12:55 +03:00
parent 7244ee3b86
commit f8a6a26f98
4 changed files with 7 additions and 6 deletions

View File

@ -38,6 +38,7 @@ timelineInfoNew(TimeLineID tli)
tlinfo->xlog_filelist = parray_new();
tlinfo->anchor_lsn = InvalidXLogRecPtr;
tlinfo->anchor_tli = 0;
tlinfo->n_xlog_files = 0;
return tlinfo;
}

View File

@ -35,7 +35,7 @@ do_delete(time_t backup_id)
parray *backup_list,
*delete_list;
pgBackup *target_backup = NULL;
int size_to_delete = 0;
size_t size_to_delete = 0;
char size_to_delete_pretty[20];
/* Get complete list of backups */
@ -814,8 +814,8 @@ delete_walfiles_in_tli(XLogRecPtr keep_lsn, timelineInfo *tlinfo,
char oldest_to_keep_str[20];
int rc;
int i;
int wal_size_logical = 0;
int wal_size_actual = 0;
size_t wal_size_logical = 0;
size_t wal_size_actual = 0;
char wal_pretty_size[20];
bool purge_all = false;

View File

@ -445,7 +445,7 @@ struct timelineInfo {
* otherwise 0 */
XLogSegNo begin_segno; /* first present segment in this timeline */
XLogSegNo end_segno; /* last present segment in this timeline */
int n_xlog_files; /* number of segments (only really existing)
size_t n_xlog_files; /* number of segments (only really existing)
* does not include lost segments */
size_t size; /* space on disk taken by regular WAL files */
parray *backups; /* array of pgBackup sturctures with info

View File

@ -822,7 +822,7 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
cur++;
/* N files */
snprintf(row->n_segments, lengthof(row->n_segments), "%u",
snprintf(row->n_segments, lengthof(row->n_segments), "%lu",
tlinfo->n_xlog_files);
widths[cur] = Max(widths[cur], strlen(row->n_segments));
cur++;
@ -996,7 +996,7 @@ show_archive_json(const char *instance_name, uint32 xlog_seg_size,
json_add_value(buf, "max-segno", tmp_buf, json_level, true);
json_add_key(buf, "n-segments", json_level);
appendPQExpBuffer(buf, "%d", tlinfo->n_xlog_files);
appendPQExpBuffer(buf, "%lu", tlinfo->n_xlog_files);
json_add_key(buf, "size", json_level);
appendPQExpBuffer(buf, "%lu", tlinfo->size);