@@ -225,14 +225,15 @@ do_retention_internal(parray *backup_list, parray *to_keep_list, parray *to_purg
225225 {
226226 pgBackup * backup = (pgBackup * ) parray_get (backup_list , i );
227227
228- /* Consider only valid backups for Redundancy */
228+ /* Consider only valid FULL backups for Redundancy */
229229 if (instance_config .retention_redundancy > 0 &&
230230 backup -> backup_mode == BACKUP_MODE_FULL &&
231231 (backup -> status == BACKUP_STATUS_OK ||
232232 backup -> status == BACKUP_STATUS_DONE ))
233233 {
234234 n_full_backups ++ ;
235235
236+ /* Add every FULL backup that satisfy Redundancy policy to separate list */
236237 if (n_full_backups <= instance_config .retention_redundancy )
237238 {
238239 if (!redundancy_full_backup_list )
@@ -260,7 +261,7 @@ do_retention_internal(parray *backup_list, parray *to_keep_list, parray *to_purg
260261 bool redundancy_keep = false;
261262 pgBackup * backup = (pgBackup * ) parray_get (backup_list , (size_t ) i );
262263
263- /* check if backups FULL parent is in redundancy list */
264+ /* check if backup`s FULL ancestor is in redundancy list */
264265 if (redundancy_full_backup_list )
265266 {
266267 pgBackup * full_backup = find_parent_full_backup (backup );
@@ -283,7 +284,6 @@ do_retention_internal(parray *backup_list, parray *to_keep_list, parray *to_purg
283284 * TODO: consider that ERROR backup most likely to have recovery_time == 0
284285 */
285286 if ((days_threshold == 0 || (days_threshold > backup -> recovery_time )) &&
286- // (instance_config.retention_redundancy <= (n_full_backups - cur_full_backup_num)))
287287 (instance_config .retention_redundancy == 0 || !redundancy_keep ))
288288 {
289289 /* This backup is not guarded by retention
0 commit comments