Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: michael(at)paquier(dot)xyz, masao(dot)fujii(at)oss(dot)nttdata(dot)com, david(at)pgmasters(dot)net, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Refactor backup related code (was: Is it correct to say, "invalid data in file \"%s\"", BACKUP_LABEL_FILE in do_pg_backup_stop?)
Date: 2022-09-27 09:41:54
Message-ID: CALj2ACVAQ0M6c+eKYawGVa-zh6o2dXnu1bgv=VwFHAHDTWR9-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 27, 2022 at 2:20 PM Kyotaro Horiguchi
<horikyota(dot)ntt(at)gmail(dot)com> wrote:
>
> > -1 from me. We have the function context and the structure name there
> > to represent that the parameter name 'state' is actually 'backup
> > state'. I don't think we gain anything here. Whenever the BackupState
> > is used away from any function, the variable name backup_state is
> > used, static variable in xlogfuncs.c
>
> There's no shadowing caused by the change. If we mind the same
> variable names between files, we could rename backup_state in
> xlogfuncs.c to process_backup_state or session_backup_state.

-1.

> If this is still unacceptable, I propose to change the comment. (I
> found that the previous patch forgets about do_pg_backup_stop())
>
> - * It fills in backup_state with the information required for the backup,
> + * It fills in the parameter "state" with the information required for the backup,

+1. There's another place that uses backup_state in the comments. I
modified that as well. Please see the attached patch.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Adjust-BackupState-comments-to-not-use-backup_sta.patch application/x-patch 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-09-27 09:53:04 Extend win32 error codes to errno mapping in win32error.c
Previous Message Benjamin Coutu 2022-09-27 09:39:31 Re: Insertion Sort Improvements