Repository navigation
mgr/dashboard: skip RGW daemons whose frontend is unreachable - #71638
Conversation
afreen23
left a comment
There was a problem hiding this comment.
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 ?
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
left a comment
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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).
I can go that route. 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. |
6cf38d5 to
c48fc1e
Compare
changes are pushed for re-review |
nizamial09
left a comment
There was a problem hiding this comment.
looks good to me, thanks a lot @mheler. let's update the PR title and description accordingly and also squash the commits together.
| 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 |
There was a problem hiding this comment.
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.
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]>
c48fc1e to
2f567b7
Compare
|
This PR has been added to wip-bharath3-testing-20260918.154843-main. |
|
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. |
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.