Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong backup check for SQL Always on High availability Groups #727

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcohald
Copy link
Contributor

This is a recreation of #518

Bug reports

operating system name and version
SQL Always on High availability Groups on SQL Server 2019
Windows Server 2019
Detailed steps to reproduce the bug

  1. Create a Backup of a High Available Database on Server1
  2. Move the Database to Server2
  3. You get a backup Error because no actual backup is found

Proposed changes

What is the expected behavior?
The Agent should return the Backup status, even if it is not the primary Server
What is the observed behavior?
The Agent does not return the Backup if it is not the Primary Replica
If it's not obvious from the above: In what way does your patch change the current behavior?
The Primary Server check is removed
Is this a new problem? What made you submit this PR (new firmware, new device, changed device behavior)?
The move of the database.

removed is_primary_replica check to get the Backup even when the actual Server does not hold the Primary Replica.

This is needed, when server1 takes a backup and then the database gets migrated to server2.
server1 does not report its successful backup because it is no longer the Primary Replica
@TimotheusBachinger
Copy link
Contributor

TimotheusBachinger commented Oct 4, 2024

Hi @marcohald,

first of all thanks for re-opening and the contribution.
When I have a look at the history of mssql.vbs, I can find this werk: https://checkmk.com/werk/4394:

In previous versions the backups of availability group cluster slave hosts (were no backup is executed) was
handled as last backup age. 
Now we exclude those backups from the monitoring and only handle the backups of the primary replica.

So your change basically reverts this (very old) werk. I cannot really tell at the moment if we would introduce a regression then - do you have an opinion about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants