Repository navigation
python-common/hostspec: normalize hostnames for case-insensitive matc… - #66820
Conversation
|
Can one of the admins verify this patch? |
14 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
This PR replaces the previous one i.e |
phlogistonjohn
left a comment
There was a problem hiding this comment.
In the future please do not close PRs and open new ones on the same topic because that breaks the flow of conversation. It could also be a seen as a way of "cheating" if somone asked for changes on the original PR but then didn't watch things closely enough to see the new PR appear. I doubt that's the case here, but it's a good reason not to open and close PRs for the same topic/branch.
If you are having trouble with git - ask for help first. Then if and only if nobody can help resolve the git issues should you consider opening a new PR for a topic that has already been discussed.
| # Type narrowing: all items are HostPlacementSpec | ||
| placement_hosts = cast(List[HostPlacementSpec], hosts) |
There was a problem hiding this comment.
I shouldn't be too cute in my reviews: what specifically happened that you think these lines are needed?
There was a problem hiding this comment.
The cast was only needed due to a mypy type-narrowing limitation. I’ve now
restructured the code so each branch builds a well-typed list directly,
which avoids the cast and keeps the behavior unchanged.
| @@ -98,6 +98,11 @@ class HostPlacementSpec(NamedTuple): | |||
| network: str | |||
| name: str | |||
|
|
|||
| @classmethod | |||
There was a problem hiding this comment.
Why is this a classmethod? It is operating on the same fields that make up the named tuple, right?
Is there a fear to create an intermediate HostPlacementSpec with incorrect case vs just chaining methods like HostPlacementSpec(foo, bar, baz).normalized()?
There was a problem hiding this comment.
Removed the classmethod and now normalize the hostname directly in
from_json to keep the code simple and clearer.
Understood, thanks for the clarification. Closing and reopening the PR was not intentional to bypass review — I ran |
phlogistonjohn
left a comment
There was a problem hiding this comment.
thanks. it looks a lot better to me now.
|
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. |
…hing Normalize HostSpec and related placement parsing to ensure hostnames are treated case-insensitively when supplied via service specs. This prevents service placement failures caused by mixed-case hostnames. Fixes: https://tracker.ceph.com/issues/74299 Signed-off-by: Shubha Jain <[email protected]>
94f52d6 to
c3d9bf0
Compare
|
jenkins retest this please |
…acementSpec Signed-off-by: Shubha Jain <[email protected]>
Made-with: Cursor Signed-off-by: Shubha Jain <[email protected]>
c3d9bf0 to
b8a4f82
Compare
|
jenkins test make check |
|
jenkins test make check arm64 |
|
Teuthology run was successful. Failing Test cases are not related to this PR: https://pulpito.ceph.com/rkachach-2026-05-11_13:27:21-orch:cephadm-wip-rkachach-testing-2026-05-11-1323-distro-default-trial/ |
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are: Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
From Ceph 21 on, cephadm lowercases the names of the hosts it manages (ceph/ceph#66820) and the monitors it deploys take that name. With an uppercase hostname in the inventory, "Confirm monitors are in monmap" looks for HOST2 in a monmap that lists mon.host2 and fails after its 30 retries while the monitor is in quorum. ceph orch ps reports lowercase host names as well, so the lookup of the mgr running on each host finds nothing and mgr/prometheus server_addr is silently left unset. Compare the names without case in both places. Older Ceph releases keep the case, which this also handles. Signed-off-by: Florent Carli <[email protected]>
From Ceph 21 on, cephadm lowercases the names of the hosts it manages (ceph/ceph#66820) and the monitors it deploys take that name. With an uppercase hostname in the inventory, "Confirm monitors are in monmap" looks for HOST2 in a monmap that lists mon.host2 and fails after its 30 retries while the monitor is in quorum. ceph orch ps reports lowercase host names as well, so the lookup of the mgr running on each host finds nothing and mgr/prometheus server_addr is silently left unset. Compare the names without case in both places. Older Ceph releases keep the case, which this also handles. Signed-off-by: Florent Carli <[email protected]>
From Ceph 21 on, cephadm lowercases the names of the hosts it manages (ceph/ceph#66820) and the monitors it deploys take that name. With an uppercase hostname in the inventory, "Confirm monitors are in monmap" looks for HOST2 in a monmap that lists mon.host2 and fails after its 30 retries while the monitor is in quorum. ceph orch ps reports lowercase host names as well, so the lookup of the mgr running on each host finds nothing and mgr/prometheus server_addr is silently left unset. Compare the names without case in both places. Older Ceph releases keep the case, which this also handles. Signed-off-by: Florent Carli <[email protected]>
From Ceph 21 on, cephadm lowercases the names of the hosts it manages (ceph/ceph#66820) and the monitors it deploys take that name. With an uppercase hostname in the inventory, "Confirm monitors are in monmap" looks for HOST2 in a monmap that lists mon.host2 and fails after its 30 retries while the monitor is in quorum. ceph orch ps reports lowercase host names as well, so the lookup of the mgr running on each host finds nothing and mgr/prometheus server_addr is silently left unset. Compare the names without case in both places. Older Ceph releases keep the case, which this also handles. Signed-off-by: Florent Carli <[email protected]>
From Ceph 21 on, cephadm lowercases the names of the hosts it manages (ceph/ceph#66820) and the monitors it deploys take that name. With an uppercase hostname in the inventory, "Confirm monitors are in monmap" looks for HOST2 in a monmap that lists mon.host2 and fails after its 30 retries while the monitor is in quorum. ceph orch ps reports lowercase host names as well, so the lookup of the mgr running on each host finds nothing and mgr/prometheus server_addr is silently left unset. Compare the names without case in both places. Older Ceph releases keep the case, which this also handles. Signed-off-by: Florent Carli <[email protected]>
Summary
Normalize hostnames at ingest to ensure case-insensitive handling in
python-common HostSpec and placement parsing logic.
Problem
Service placement could fail with "Unknown hosts" when mixed-case
hostnames were used in service specs while the host was registered
in lowercase.
Solution
Testing
Fixes: https://tracker.ceph.com/issues/74299
Signed-off-by: Shubha Jain [[email protected]]
Testing Logs
BEFORE FIX — Reproduce the Issue
AFTER FIX:
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.