Skip to content

Fix SQL dumps on mirroring passive servers from FinOps collectors#537

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/finops-mirror-passive-crash
Mar 12, 2026
Merged

Fix SQL dumps on mirroring passive servers from FinOps collectors#537
erikdarlingdata merged 1 commit intodevfrom
fix/finops-mirror-passive-crash

Conversation

@erikdarlingdata
Copy link
Owner

Summary

Test plan

  • Install on SQL 2016 mirroring passive server — verify no dumps
  • Verify both FinOps collectors complete successfully on servers with RESTORING databases

Fixes #535

🤖 Generated with Claude Code

The database_size_stats and server_properties collectors iterate
databases with cursor-based dynamic SQL. On mirroring passive servers,
RESTORING databases must be excluded to prevent severity 22 engine
crashes (same root cause as #384 and #430).

- database_size_stats: Change state_desc filter to d.state = 0
- server_properties: Change state_desc filter to d.state = 0,
  add HAS_DBACCESS() check (was missing entirely)

Fixes #535

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 3df331a into dev Mar 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant