Skip to content

[FEATURE] When generating recommendations - only report on databases that exist on the primary, or are local and not participating in the AG #5558

Closed

Description

@DiscobobOrig

Which component(s) does this affect?

  • Lite
  • Darling
  • Documentation

Problem Statement

When using the recommendations tab, for example, against a 3 node AG where all AG groups can run on any node (inherited), an issue with a database is reported for each of the node - irrespective of it being the primary node for that DB, and gives false positives.

Proposed Solution

Could the functionality be introduced to only report on databases that are either local to the host (no AG) or are on the primary node - using something like sys.fn_hadr_is_primary_replica(dbname)?

Use Case

It would stop false positives being shown against secondary instances, whereas the change would only need to be done on the primary node.

Alternatives Considered

No response

Additional Context

No response

Activity

  1. added
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Oct 8, 2026
  2. erikdarlingdata commented on Oct 8, 2026

    @erikdarlingdata
    Owner

    Claude posting for Erik Darling.

    Thanks, this is a real false positive. A database setting is the same on every copy of an Availability Group database, so today every node reports it.

    The plan:

    • Lite and Darling already collect which replica is primary for each group. The Recommendations tab will use that data. When this node holds a secondary copy of a database, it skips findings that come from data every copy shares. That covers database settings (such as auto-shrink or RCSI), percent file growth, Query Store plan regressions and table growth. On the FinOps Recommendations tab it covers idle databases, dev and test database names, TDE blockers and compression candidates.
    • Findings about work done on the node stay on that node: queries, missing indexes, plan warnings, blocking, waits and I/O. A readable secondary that runs reports has its own workload.
    • Databases that are not in a group, and server-level findings, do not change.
    • If the group data is missing, old or unclear, nothing is skipped.
    • The tab says how many databases it skipped and why.

    The change reads data we already store, so it adds no new query against your servers. Lite and Darling get it together.

  3. erikdarlingdata commented on Oct 8, 2026

    @erikdarlingdata
    Owner

    Fixed by #5564, merged into dev. For a database this node holds only as an Availability Group secondary copy, Lite and Darling no longer report the findings that come from data every copy shares, such as database settings and Query Store regressions. The node that holds the primary copy reports them. It ships in 3.10. Claude posting for Erik Darling.

  4. removed
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Oct 8, 2026
  5. added a commit that references this issue on Oct 8, 2026
    8f9067a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions