Skip to content

HealthMonitor: Add topology-aware netsplit detection and warning - #59248

Merged
rzarzynski merged 2 commits into
ceph:mainfrom
kamoltat:wip-ksirivad-improve-netsplit-warning
Apr 24, 2025
Merged

rzarzynski merged 2 commits into
ceph:mainfrom
kamoltat:wip-ksirivad-improve-netsplit-warning

Conversation

@kamoltat

@kamoltat kamoltat commented Aug 15, 2024 •

Copy link
Copy Markdown
Member

NOTE:

This PR is dependent on #62416 and should always be tested together.

Problem:

Currently, Ceph cannot detect and report network partitions (netsplits)
between monitors in different topology locations in a consolidated way.
While stretch mode can handle partitions through monitor elections,
users lack visibility into the topology-level view of network
disconnections, making troubleshooting difficult.

Solution:

This implementation adds a hierarchical netsplit detection mechanism that:
  - Uses DirectedGraph structure for netsplit detection
  - Maps monitor disconnections to relevant CRUSH topology levels
  - Aggregates individual disconnections into location-level reports when appropriate
  - Detects complete location-level netsplits when ALL monitors between locations
    cannot communicate
  - Reports specific topology locations experiencing complete communication failures
  - Falls back to individual monitor-level reporting for partial disconnections
  - Handles monitors with missing location data gracefully
  - Leverages HealthMonitor::check_for_mon_down to receive a set of down monitors,
    efficiently avoiding false netsplit reports for monitors already known to be down
  - Implements smart filtering that correctly excludes down monitors from location-based
    analysis, ensuring accurate netsplit reporting at both individual and topology levels

The implementation produces user-friendly health warnings:
1. For complete location netsplits: "Netsplit detected between dc1 and dc2"
2. For individual monitor disconnections: "Netsplit detected between mon.a and mon.d"

Performance considerations:

 - Time complexity: O(m²) where m is the number of monitors
 - Space complexity: O(m²) for connection tracking
 - Practical impact is minimal as monitor count is typically small (3-7)

Fixes: https://tracker.ceph.com/issues/67371

Signed-off-by: Kamoltat Sirivadhna [email protected]

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@kamoltat kamoltat self-assigned this Aug 15, 2024
@kamoltat
kamoltat requested a review from a team as a code owner August 15, 2024 20:31
@kamoltat
kamoltat force-pushed the wip-ksirivad-improve-netsplit-warning branch 3 times, most recently from 029640f to d68b351 Compare August 23, 2024 13:23
@kamoltat

Copy link
Copy Markdown
Member Author

@kamoltat kamoltat added the needs-squid-backport PR needs a squid backport label Aug 23, 2024
@kamoltat kamoltat changed the title HealthMonitor: Add MON_NETSPLIT Warning MON: allow monitors to detect netsplit when using Connectivity election strategy Aug 23, 2024
@kamoltat
kamoltat requested a review from a team as a code owner August 23, 2024 20:27
@kamoltat
kamoltat requested a review from gregsfortytwo August 23, 2024 20:27
@kamoltat kamoltat changed the title MON: allow monitors to detect netsplit when using Connectivity election strategy MON: allow monitors to detect netsplit when using connectivity election strategy Aug 23, 2024

@anthonyeleven anthonyeleven left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Several doc suggestions; I am not worthy to review the code.

Comment thread doc/rados/operations/health-checks.rst Resolved
Comment thread doc/rados/operations/health-checks.rst Resolved
Comment thread doc/rados/operations/health-checks.rst Resolved
Comment thread src/mon/HealthMonitor.cc Resolved
Comment thread src/mon/HealthMonitor.cc Resolved
@kamoltat
kamoltat force-pushed the wip-ksirivad-improve-netsplit-warning branch from e601b57 to e8ef616 Compare August 26, 2024 13:07
@kamoltat

Copy link
Copy Markdown
Member Author

@anthonyeleven Thanks for correcting my writing!

@kamoltat

Copy link
Copy Markdown
Member Author

@gregsfortytwo need your approval for this PR

@kamoltat

Copy link
Copy Markdown
Member Author

jenkins test api

@kamoltat

Copy link
Copy Markdown
Member Author

@anthonyeleven I pushed the doc fixes to this PR per your request, let me know if they are any good.

@kamoltat

Copy link
Copy Markdown
Member Author

@gregsfortytwo ping

@kamoltat

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Jan 26, 2025
@rzarzynski

Copy link
Copy Markdown
Contributor

Unstale please!

@github-actions github-actions Bot removed the stale label Feb 14, 2025
@kamoltat

Copy link
Copy Markdown
Member Author

@gregsfortytwo Ping for review

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@ljflores

Copy link
Copy Markdown
Member

@ljflores ljflores closed this Apr 22, 2025
@ljflores ljflores reopened this Apr 22, 2025
@ljflores

Copy link
Copy Markdown
Member

Closed/reopened to try and get the "missing .qa links" check to actually run.

@kamoltat

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

Problem:
Currently, Ceph cannot detect and report network partitions (netsplits)
between monitors in different topology locations in a consolidated way.
While stretch mode can handle partitions through monitor elections,
users lack visibility into the topology-level view of network
disconnections, making troubleshooting difficult.

Solution:
This implementation adds a hierarchical netsplit detection mechanism that:
- Uses DirectedGraph structure for netsplit detection
- Maps monitor disconnections to relevant CRUSH topology levels
- Aggregates individual disconnections into location-level reports when appropriate
- Detects complete location-level netsplits when ALL monitors between locations
  cannot communicate
- Reports specific topology locations experiencing complete communication failures
- Falls back to individual monitor-level reporting for partial disconnections
- Handles monitors with missing location data gracefully
- Leverages HealthMonitor::check_for_mon_down to receive a set of down monitors,
  efficiently avoiding false netsplit reports for monitors already known to be down
- Implements smart filtering that correctly excludes down monitors from location-based
  analysis, ensuring accurate netsplit reporting at both individual and topology levels

The implementation produces user-friendly health warnings:
1. For complete location netsplits: "Netsplit detected between dc1 and dc2"
2. For individual monitor disconnections: "Netsplit detected between mon.a and mon.d"

Performance considerations:
- Time complexity: O(m²) where m is the number of monitors
- Space complexity: O(m²) for connection tracking
- Practical impact is minimal as monitor count is typically small (3-7)

Fixes: https://tracker.ceph.com/issues/67371

Signed-off-by: Kamoltat Sirivadhna <[email protected]>

Conflicts:
	src/mon/Elector.cc - Trivial Fix
@kamoltat
kamoltat force-pushed the wip-ksirivad-improve-netsplit-warning branch from b344c7b to a5248f5 Compare April 22, 2025 21:45
@kamoltat

Copy link
Copy Markdown
Member Author

jenkins test api

@kamoltat

Copy link
Copy Markdown
Member Author

jenkins test make check

@rzarzynski

Copy link
Copy Markdown
Contributor

Unrelated:

208/317 Test #203: mgr-dashboard-smoke.sh ...........................***Failed  162.40 sec

@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test make check

2 similar comments
@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test make check

@ljflores

Copy link
Copy Markdown
Member

jenkins test make check

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.

5 participants