Skip to content

mgr/dashboard: skip RGW daemons whose frontend is unreachable - #71638

Merged
nizamial09 merged 1 commit into
ceph:mainfrom
mheler:wip-dashboard-rgw-override
Sep 24, 2026
Merged

nizamial09 merged 1 commit into
ceph:mainfrom
mheler:wip-dashboard-rgw-override

Conversation

@mheler

@mheler mheler commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard picks the first daemon in the default zonegroup and only finds out it can't reach its frontend after the request timeout, which takes the whole Object section down when a gateway outside the cluster sorts first in the service map.

Before caching a client, check that the daemon's frontend accepts a TCP connection within two seconds and move on to the next daemon when it doesn't. A daemon the dashboard already talks to is preferred, so an unreachable one is probed once and not on every request.

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

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@afreen23 afreen23 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.

Is there a reason we can't retry the next available daemon in the zonegroup when the selected one fails the status probe, rather than requiring a manual pin? Wanted to understand if there's a constraint I'm missing here ?

cc @nizamial09 @epuertat

@mheler

mheler commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Is there a reason we can't retry the next available daemon in the zonegroup when the selected one fails the status probe, rather than requiring a manual pin? Wanted to understand if there's a constraint I'm missing here ?

cc @nizamial09 @epuertat

The gateway looks healthy in the service map, so a retry has to probe it and wait out the 45 (default) second request timeout on every Object page load.

@nizamial09 nizamial09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @mheler

I am not really fond of putting this burden to the user... Probably what we lack in the dashboard is that when we select a daemon, we are not verifying its connectivity first before we chose that daemon and use it for sending request? Is it better to just attempt a simple socket.connect() to verify connectivity first before we caches that daemon? maybe with a 1-2s timeout? that generalizes the problem when no daemon is selected and could work for UI as well when a particular daemon is selected...? wdyt?

And another reason for this small check is that, it properly differentiates b/w service availability and unreachable frontend.

Btw, you can customize the 45s timeout

ceph dashboard set-rest-requests-timeout <seconds>

daemon_keys = RgwClient._daemons.keys()
default_daemon = Settings.RGW_DEFAULT_DAEMON
if not daemon_name and default_daemon:
if default_daemon in daemon_keys:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if the pinned daemon is running (its in service map) but its frontend is unreachable from active mgr, then the dashboard will still attempt to connect to it, wait for 45s and lock up the UI still right? this is only triggered if its completely removed from the mg map unless I am missing something here..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where's the 45 sec coming from? Most HTTP-like clients have a tunable connection time-out.

If we want to minimize disruption we can do:

  • Connection pooling: we connect not to 1 but multiple (e.g.: 3) RGW daemons.
  • Speculative retry: this is an idea taken from Cassandra, where the client samples the delay (connection, reads) of the last events, and uses that as a reference to infer time-outs (without having to wait for the real one). It internally sets a client timeout to something like min(50ms, p_99).

It's a pity that only RGW uses the service map. BTW, service map allows RADOS clients/applications to share metadata, where the entry gets deleted if the connection dies (e.g.: the RADOS client stops sending beacons).

Comment thread doc/mgr/dashboard.rst Resolved
@mheler

mheler commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @mheler

I am not really fond of putting this burden to the user... Probably what we lack in the dashboard is that when we select a daemon, we are not verifying its connectivity first before we chose that daemon and use it for sending request? Is it better to just attempt a simple socket.connect() to verify connectivity first before we caches that daemon? maybe with a 1-2s timeout? that generalizes the problem when no daemon is selected and could work for UI as well when a particular daemon is selected...? wdyt?

And another reason for this small check is that, it properly differentiates b/w service availability and unreachable frontend.

Btw, you can customize the 45s timeout

ceph dashboard set-rest-requests-timeout <seconds>

I can go that route. Would it be preferable to close this PR and re-open it with that change?

@nizamial09

Copy link
Copy Markdown
Member

Would it be preferable to close this PR and re-open it with that change?

we can keep this PR and make changes on top of this. so we can retain context and history.

@mheler
mheler force-pushed the wip-dashboard-rgw-override branch from 6cf38d5 to c48fc1e Compare September 15, 2026 21:56
@mheler

mheler commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Would it be preferable to close this PR and re-open it with that change?

we can keep this PR and make changes on top of this. so we can retain context and history.

changes are pushed for re-review

@nizamial09 nizamial09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me, thanks a lot @mheler. let's update the PR title and description accordingly and also squash the commits together.

Comment on lines +140 to +147
def _is_reachable(daemon: RgwDaemon) -> bool:
try:
with socket.create_connection((daemon.host, daemon.port), timeout=2):
return True
except OSError as e:
logger.warning('RGW daemon %s at %s:%d is unreachable: %s',
daemon.name, daemon.host, daemon.port, e)
return False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i like this actually, probably something we should have as a generic thing in the dashboard as a fail-safe for whenever dashboard tries to attempt an external connection like prometheus, nvmeof etc.. but we can make it generic as we see fit.

@github-project-automation github-project-automation Bot moved this from New to Reviewer approved in Ceph-Dashboard Sep 16, 2026
@mheler mheler changed the title mgr/dashboard: add a setting to pin the RGW daemon the dashboard uses mgr/dashboard: skip RGW daemons whose frontend is unreachable Sep 16, 2026
The dashboard picks the first daemon in the default zonegroup and only
finds out it can't reach its frontend after the request timeout, which
takes the whole Object section down when a gateway outside the cluster
sorts first in the service map.

Before caching a client, check that the daemon's frontend accepts a TCP
connection within two seconds and move on to the next daemon when it
doesn't. A daemon the dashboard already talks to is preferred, so an
unreachable one is probed once and not on every request.

Signed-off-by: Matthew N. Heler <[email protected]>
@mheler
mheler force-pushed the wip-dashboard-rgw-override branch from c48fc1e to 2f567b7 Compare September 16, 2026 16:01
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath3-testing-20260918.154843-main.

@anrao19

anrao19 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:10.

@anrao19 anrao19 added rgw RGW-TESTED testing from rgw completed labels Sep 23, 2026
@anrao19

anrao19 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by anuchaithra started 2026-09-22-04:10.

Testing completed for RGW suites and got approval from @ivancich, more details in https://tracker.ceph.com/issues/80712.
@mheler, its an ack from RGW

@kamoltat

Copy link
Copy Markdown
Member

@nizamial09
nizamial09 merged commit 98fb1cf into ceph:main Sep 24, 2026
22 of 23 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Sep 24, 2026
@anrao19 anrao19 removed the wip-anrao6-testing wip-anrao6-testing label Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants