Skip to content

Conversation

@eric-weaver
Copy link
Contributor

What does this PR do?

Currently when replication metric reporting is enabled we report back group replication OR traditional primary/replica replication. It's possible for Mysql topologies to make use of both replication methods. The changes in this pull request extend support so that we collect both if they are both identified as active.

A new test harness for integration tests was added which spins up a 3 node group replication setup with a 4th instance that is configured as a traditional replication replica of node1.

Motivation

The ability to collect metrics for mixed replication topologies was requested in https://datadoghq.atlassian.net/browse/SDBM-2310

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51485de760

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +776 to +780
has_traditional_replication = replica_stats or replicas_connected.get('Replicas_connected', 0) > 0
if has_traditional_replication:
results.update(replica_stats)
results.update(replicas_connected)
return REPLICA_VARS

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve replication status when source has 0 replicas

When replication_enabled is true on a traditional source with no connected replicas (or all replicas temporarily offline), replica_stats is empty and Replicas_connected is 0, so has_traditional_replication is false and the method returns {}. That prevents _check_replication_status from running and suppresses the mysql.replication.* service checks/metrics that previously signaled a WARNING for “source with 0 replicas,” which can mask replica-loss conditions in non-group replication setups.

Useful? React with 👍 / 👎.

@datadog-official
Copy link
Contributor

datadog-official bot commented Jan 30, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 76e58bf | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 52.38095% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.14%. Comparing base (b9883f5) to head (76e58bf).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants