Skip to content

Add option to skip archive_command validation during standby clone #902

@acastro2

Description

@acastro2

Description:

Problem

repmgr standby clone performs a hard validation check that fails when archive_mode = on but archive_command = '' (empty string). This creates a conflict with backup solutions that require archive_command to be empty so they can manage WAL archiving themselves.

Error:

ERROR: parameter "archive_command" must be set to a valid command

Relevant code (from repmgr-action-standby.c):

https://github.com/EnterpriseDB/repmgr/blame/e696e28f438fcc73beaaec9a17238286f9a77115/repmgr-action-standby.c#L6443

if (guc_set(conn, "archive_mode", "!=", "off"))
{
    i = guc_set(conn, "archive_command", "!=", "");
    if (i == 0 || i == -1)
    {
        log_error(_("parameter \"archive_command\" must be set to a valid command"));
        exit(ERR_BAD_CONFIG);
    }
}

Real-World Use Case

Veeam Backup & Replication explicitly requires PostgreSQL instances to have:

archive_mode = on
archive_command = ''  # MUST be empty

[Official Veeam documentation](https://helpcenter.veeam.com/docs/backup/vsphere/postgresql_backup.html) states: "The archive_command parameter must not contain any values in PostgreSQL instances."

Veeam manages WAL archiving through its own mechanisms and sets archive_command dynamically during backup operations. Having a pre-configured command interferes with this process.

Current Workarounds (All Problematic)

  1. Temporarily set /bin/true then change back after clone

    • Requires manual intervention or complex automation
    • Creates a window where the configuration is wrong for Veeam
    • Not suitable for automated deployments
  2. Manual clone with pg_basebackup then register

    • Bypasses repmgr's useful pre-flight checks
    • More error-prone
    • Loses the benefits of repmgr standby clone

Proposed Solution

Add a flag to skip archive_command validation:

repmgr standby clone --skip-archive-validation
# or
repmgr standby clone --no-check-archive-command

This would allow users who understand the implications (and are using external backup solutions) to proceed with empty archive_command.

Alternative Solutions

  1. Make the validation a warning instead of a hard error
  2. Add a configuration option in repmgr.conf: validate_archive_command = false
  3. Only validate if NOT using streaming replication (where archive_command is less critical)

Environment

  • PostgreSQL: 15
  • repmgr: 5.x
  • Backup solution: Veeam Backup & Replication
  • OS: Ubuntu 24

Additional Context

According to [PostgreSQL documentation](https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-ARCHIVE-COMMAND), setting archive_command = '' is a valid configuration for temporarily disabling archiving while keeping archive_mode = on. Many enterprise backup solutions (Veeam, Commvault, etc.) rely on this pattern.

The hard validation in repmgr makes it incompatible with these enterprise backup solutions without workarounds, which is a significant limitation for production deployments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions