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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, David Steele <david@pgmasters.net>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-27T00:15:59Z
Lists: pgsql-hackers
On Mon, Sep 26, 2022 at 11:57:58AM +0530, Bharath Rupireddy wrote:
> +1 because callers don't use returned StringInfo structure outside of
> build_backup_content(). The patch looks good to me.

Thanks for looking.

> I think it will be
> good to add a note about the caller freeing up the retired string's
> memory [1], just in case.

Not sure that this is worth it.  It is fine to use palloc() in a
dedicated memory context, for one.
--
Michael

Commits

  1. Fix some comments of do_pg_backup_start() and do_pg_backup_stop()

  2. Remove dependency to StringInfo in xlogbackup.{c.h}

  3. Refactor creation of backup_label and backup history files

  4. Move basebackup code to new directory src/backend/backup

  5. Remove exclusive backup mode