PostgreSQL 10 backup from standby server

Last post 08-15-2019, 4:21 AM by chelydridae. 6 replies.
Sort Posts: Previous Next
  • PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 4:01 AM

    Dear all

    We are running a Postgresql 10 Cluster and tried the new "Enable Standby Backup" option.

    Everything seems to work fine, full FSBasedBackups are done as well as log-backups.

    But looking at the Commvault logfiles I am unsure whether or not the standby server is now effectivley involved.

    In the PostGresBackupParent.log on the PG master server I see for a fullbackup the following lines:

    27153 6a11 08/13 22:30:28 667010 PostGresClBackupBase::PostGresInitialize() - Backup from Standby is enabled.
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::Init() - Primary instance Id [151], Secondary instance Id [152]
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::Init() - Checking if this is primary or secondary server.
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::CheckIfPrimaryOrSecondary() - Primary instance: Instance Id [151], client Id [312]
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::CheckIfPrimaryOrSecondary() - Secondary instance: Instance Id [152], Client ID [313].
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::CheckIfPrimaryOrSecondary() - primaryHostName [bgs-db-prod-pg10-01], secondary host name [bgs-db-prod-pg10-02], physicalClientName [bgs-db-prod-pg10-01].
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::CheckIfPrimaryOrSecondary() - This is primary [bgs-db-prod-pg10-01]
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::Init() - The physical system is [Primary] system
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::Init() - Primary role [Master], Secondary role[Standby]
    27153 6a11 08/13 22:30:28 667010 PostgresStandbyBackup::Init() - Running backup on primary server. Server code [1]

    so, the agent has 'Backup from Standby' enabled
    it knows primary and secondary hosts,
    but it says 'running backup on primary server'

    So the secondary system is not involved at all?

    If this is true - any idea what could be missing? For there are no errors in the logs as far as I can see.

    Thanks for sharing

  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 9:50 AM

    Hi ,

     

    This is a log snippet from master client. We do connect to master (from standby) to understand the logs required for a consistent backup. Logging says Running backup on primary server. But it is actually collecting only log file related information if you see further logging. That is the expected behavior.

    Please check the logs in standby client. Collect File generation and actual backup should happen from standby. We will get a clear picture from PostGresIfind and PostGresBackupChild logs from standby client 

     

    Regards,

    Meera

  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 10:06 AM

    Hello and thank you for your comment.

    Actually I see a short connection from standby to master on port 8400, then changing to high-port <-> high-port; so far normal behaviour of Commvault.

    But looking at PostGresIfind.log and PostGresBackupChild.log on standby, all I see are entries for a daily DumpBased backup I scheduled on standby:

    12208 30a9 08/14 04:01:33 667297 PGCommon::RunUnixCommandErrorOutputInFile() - sh -c "/usr/pgsql-10/bin/pg_dump   -U cvltBackup -Fc -b  --port=5432 'mampf' > /opt/commvault/iDataAgent/jobResults/CV_JobResults/2/0/667297/pipe667297_12208" 2>> /opt/commvault/iDataAgent/jobResults/CV_JobResults/2/0/667297/pg_dump_667297_12208 0

    So there is actually something misconfigured? Time to engage support?

    regards

    Markus

  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 10:16 AM

    Hi Markus,

     

    Please check the logs for job 667010 , ran for fsbased backupset. 

     

    For dumpbased backups, it will be run on the client where it is initiated. 

    If its initiated on master, it will run on master. 

     

    Only for fsbased backupset, if backup is initiated from master, it connects to the standby and actual backup runs from the standby. 

     

    Regards,

    Meera 

  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 10:46 AM

    From the Job History -> View Logs on job 667010

    lists logs from CommServe and PG master:

    Commserve:
    - archiveIndex.log
    - CreateIndex.log
    - CVD
    - JobManager
    - MediaManager
    ...
    Master:
    - PostGresIfind.log
    - PostGresBackupParent.log
    - PostGresBackupChild.log
    - PostGresLogBackupParent.log
    - PostGresLogBackupChild.log
    - cvd.log

    - nothing from standby.

    Also a grep for 667010 on standby /var/log/commvault/Log_files returns nothing - it really seems, that there is no activity on the standby for FSbasedBackup or log-backup.

    Thank you again for your input and time.

  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-14-2019, 8:58 PM
    Hi Markus, If there is a chance of logs in standby being overwritten with new scheduled jobs , please check with a new job. Incase there is connectivity issue between standby and CS, and in the instance properties “use master if standby is unavailable” option is set, then also backup will happen from master. To check this easily , please disable this option and try a new backup. If these two are not the case, please engage support Regards, Meera
  • Re: PostgreSQL 10 backup from standby server
    Posted: 08-15-2019, 4:21 AM

    Hi Meera

    Good idea to uncheck 'use master if standby is unavailable' - from then on, there is log-activity on the standby when running backup jobs.

    After reenabling 'use master if standby is unavailable' and doing another full backup still triggers lot of activity on the standby.

    To me this looks like a minor bug that some configurations might not be correctly or completly written to the database or clients.

    I just re-configured another pair of Postgresql servers and here was activity on the standby right from the beginning.

    Thank you for your assistance and support!

    regards

The content of the forums, threads and posts reflects the thoughts and opinions of each author, and does not represent the thoughts, opinions, plans or strategies of Commvault Systems, Inc. ("Commvault") and Commvault undertakes no obligation to update, correct or modify any statements made in this forum. Any and all third party links, statements, comments, or feedback posted to, or otherwise provided by this forum, thread or post are not affiliated with, nor endorsed by, Commvault.
Commvault, Commvault and logo, the “CV” logo, Commvault Systems, Solving Forward, SIM, Singular Information Management, Simpana, Commvault Galaxy, Unified Data Management, QiNetix, Quick Recovery, QR, CommNet, GridStor, Vault Tracker, InnerVault, QuickSnap, QSnap, Recovery Director, CommServe, CommCell, SnapProtect, ROMS, and CommValue, are trademarks or registered trademarks of Commvault Systems, Inc. All other third party brands, products, service names, trademarks, or registered service marks are the property of and used to identify the products or services of their respective owners. All specifications are subject to change without notice.
Close
Copyright © 2019 Commvault | All Rights Reserved. | Legal | Privacy Policy