| From: | Michael Paquier <michael(at)paquier(dot)xyz> | 
|---|---|
| To: | Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> | 
| Cc: | torikoshia(at)oss(dot)nttdata(dot)com, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org | 
| Subject: | Re: Allow pg_archivecleanup to remove backup history files | 
| Date: | 2023-05-26 05:06:10 | 
| Message-ID: | ZHA+QuqIgKQVzUFV@paquier.xyz | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On Fri, May 26, 2023 at 10:07:48AM +0900, Kyotaro Horiguchi wrote:
> +			if (!IsXLogFileName(walfile) && !IsPartialXLogFileName(walfile) &&
> +				(!cleanBackupHistory || !IsBackupHistoryFileName(walfile)))
> +				continue;
> 
> I'm not certain about the others, but I see this a tad tricky to
> understand at first glance. Here's how I would phrase it. (A nearby
> comment might require a tweak if we go ahead with this change.)
> 
> 		if (!(IsXLogFileName(walfile) || IsPartialXLogFileName(walfile) ||
> 			(cleanBackupHistory && IsBackupHistoryFileName(walfile))))
> or 
> 		if (!IsXLogFileName(walfile) && !IsPartialXLogFileName(walfile) &&
> 			!(cleanBackupHistory && IsBackupHistoryFileName(walfile)))
FWIW, I am OK with what's written in the patch, but it is true that
your second suggestion makes things a bit easier to read, perhaps.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2023-05-26 05:19:38 | Re: Allow pg_archivecleanup to remove backup history files | 
| Previous Message | Michael Paquier | 2023-05-26 02:08:52 | Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~? |