@@ -36,7 +36,7 @@ do_delete(InstanceState *instanceState, time_t backup_id)
3636 parray * backup_list ,
3737 * delete_list ;
3838 pgBackup * target_backup = NULL ;
39- size_t size_to_delete = 0 ;
39+ int64 size_to_delete = 0 ;
4040 char size_to_delete_pretty [20 ];
4141
4242 /* Get complete list of backups */
@@ -682,12 +682,11 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
682682 * at least one backup and no file should be removed.
683683 * Unless wal-depth is enabled.
684684 */
685- if ((tlinfo -> closest_backup ) && instance_config .wal_depth < = 0 )
685+ if ((tlinfo -> closest_backup ) && instance_config .wal_depth = = 0 )
686686 continue ;
687687
688688 /* WAL retention keeps this timeline from purge */
689- if (instance_config .wal_depth >= 0 && tlinfo -> anchor_tli > 0 &&
690- tlinfo -> anchor_tli != tlinfo -> tli )
689+ if (tlinfo -> anchor_tli > 0 && tlinfo -> anchor_tli != tlinfo -> tli )
691690 continue ;
692691
693692 /*
@@ -701,7 +700,7 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
701700 */
702701 if (tlinfo -> oldest_backup )
703702 {
704- if (instance_config . wal_depth >= 0 && !(XLogRecPtrIsInvalid (tlinfo -> anchor_lsn )))
703+ if (!(XLogRecPtrIsInvalid (tlinfo -> anchor_lsn )))
705704 {
706705 delete_walfiles_in_tli (instanceState , tlinfo -> anchor_lsn ,
707706 tlinfo , instance_config .xlog_seg_size , dry_run );
@@ -714,7 +713,7 @@ do_retention_wal(InstanceState *instanceState, bool dry_run)
714713 }
715714 else
716715 {
717- if (instance_config . wal_depth >= 0 && !(XLogRecPtrIsInvalid (tlinfo -> anchor_lsn )))
716+ if (!(XLogRecPtrIsInvalid (tlinfo -> anchor_lsn )))
718717 delete_walfiles_in_tli (instanceState , tlinfo -> anchor_lsn ,
719718 tlinfo , instance_config .xlog_seg_size , dry_run );
720719 else
@@ -942,7 +941,7 @@ delete_walfiles_in_tli(InstanceState *instanceState, XLogRecPtr keep_lsn, timeli
942941 join_path_components (wal_fullpath , instanceState -> instance_wal_subdir_path , wal_file -> file .name );
943942
944943 /* save segment from purging */
945- if (instance_config . wal_depth >= 0 && wal_file -> keep )
944+ if (wal_file -> keep )
946945 {
947946 elog (VERBOSE , "Retain WAL segment \"%s\"" , wal_fullpath );
948947 continue ;
@@ -1027,7 +1026,7 @@ do_delete_status(InstanceState *instanceState, InstanceConfig *instance_config,
10271026 parray * backup_list , * delete_list ;
10281027 const char * pretty_status ;
10291028 int n_deleted = 0 , n_found = 0 ;
1030- size_t size_to_delete = 0 ;
1029+ int64 size_to_delete = 0 ;
10311030 char size_to_delete_pretty [20 ];
10321031 pgBackup * backup ;
10331032
0 commit comments