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: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Steele <david(at)pgmasters(dot)net>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Hackers <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-12 11:39:17
Message-ID: CALj2ACW-K2CD61Z1-=+QZvXj6fTHFMLsKDjJJ+26Q1i4iw9oOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 12, 2022 at 1:12 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Aug 11, 2022 at 09:55:13AM +0530, Bharath Rupireddy wrote:
> > Here's the v2 patch, no change from v1, just rebased because of commit
> > a8c012869763c711abc9085f54b2a100b60a85fa (Move basebackup code to new
> > directory src/backend/backup).
>
> I was skimming at this patch, and indeed it is a bit crazy to write
> the generate the contents of the backup_label file at backup start,
> just to parse them again at backup stop with these extra sscan calls.

Thanks for taking a look at the patch.

> -#define PG_STOP_BACKUP_V2_COLS 3
> +#define PG_BACKUP_STOP_V2_COLS 3
> It seems to me that such changes, while they make sense with the new
> naming of the backup start/stop functions are unrelated to what you
> are trying to solve primarily here. This justifies a separate
> cleanup, but I am perhaps overly-pedantic here :)

I've posted a separate patch [1] to adjust the macro name alone.

Please review the attached v3 patch after removing the above macro changes.

[1] https://www.postgresql.org/message-id/CALj2ACXjvC28ppeDTCrfaSyHga0ggP5nRLJbsjx%3D7N-74UT4QA%40mail.gmail.com

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

Attachment Content-Type Size
v3-0001-Refactor-backup-related-code.patch application/octet-stream 28.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-09-12 12:28:08 Re: Assertion failure in WaitForWALToBecomeAvailable state machine
Previous Message Bharath Rupireddy 2022-09-12 11:36:16 Adjust macro name in pg_backup_stop()