client: check mds down status before getting mds_gid_t from mdsmap#52258
client: check mds down status before getting mds_gid_t from mdsmap#52258
Conversation
2df373b to
812f910
Compare
|
Hi @batrick have a code review |
src/client/Client.cc
Outdated
| if (fsmap->get_filesystem(role.fscid)->mds_map.is_down(role.rank)) { | ||
| lderr(cct) << __func__ << ": targets rank: " << role.rank | ||
| << " is down" << dendl; | ||
| return -CEPHFS_ENOENT; |
There was a problem hiding this comment.
I think a better return value would be -CEPHFS_EPERM as we want to say "resolving mds is not allowed when the mds is down".
There was a problem hiding this comment.
else other changes looks good.
|
Since you have steps to reproduce this; can we have a test case? |
812f910 to
17f037e
Compare
|
@dparmar18 Okay, but I lack experience of write test cases, could you provide me an example? |
I'll check and see if i can find one because (at least) I haven't came across any test cases where a restful API is used to check MDS. |
You could directly write a test case to associate this fix, I am looking forward to it very much :) |
|
can someone from @ceph/dashboard help identify how and where to add a test case for this since it involves querying dashboard |
batrick
left a comment
There was a problem hiding this comment.
The convention is to use lower case in the commit message component/title. Please change to: client: check mds down status bofore getting mds_gid_t from mdsmap
|
You could write a test: |
17f037e to
e017e62
Compare
I think @YiteGu can follow the steps he mentioned in tracker and add a api test in https://github.com/ceph/ceph/blob/main/qa/tasks/mgr/dashboard/test_cephfs.py, it would be as simple as thanks to @nizamial09 for helping find the right place. |
e017e62 to
e62e690
Compare
2ab9f59 to
d3de04c
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
…fails Fixes: https://tracker.ceph.com/issues/64089 Signed-off-by: Dhairya Parmar <dparmar@redhat.com> (cherry picked from commit 564dba3)
746917a to
67378bd
Compare
make check done |
|
This run still has quay fetch failures
I'll file a tracker for that and merge this batch. |
* refs/pull/52258/head: client: check mds down status bofore getting mds_git_t from mdsmap mgr/dashboard: allow sending back error status code fetching clients fails Reviewed-by: Dhairya Parmar <dparmar@redhat.com> Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
rishabh-d-dave
left a comment
There was a problem hiding this comment.
@YiteGu Since the PR has been tested and approved already, feel free to skip ignore thi nits.
67378bd to
177491e
Compare
done, thanks. :) |
Unfortunately it was risky to merge the change without a proper run. The fix for this is under test. |
|
@YiteGu nit: I think the typedef is named
|
Get mds_gid_t from up of MDSMap, will cause to core dump if target
mds_rank_t does not exist up map:
from: src/mds/MDSMap.h
const auto& get_info(mds_rank_t m) const {
return mds_info.at(up.at(m));
}
reproduct:
1. ceph fs fail <fs_name>
2. curl -X GET "example.com:8080/api/cephfs/1/clients" ...
up.at(m) will cause to core dump.
Fixes: https://tracker.ceph.com/issues/61844
Signed-off-by: Yite Gu <yitegu0@gmail.com>
177491e to
878463e
Compare
done |
|
jenkins test dashboard |
|
@YiteGu Could you please get the failing dashboard jenkins test resolved. Its not a mandatory check to merge a change, however I'd like to be certain that this change does not break dashboard tests. |
I remember @nizamial09 said we could ignore the ceph dashboard tests and ceph dashboard cephadm e2e tests, pls help our check this problem again. |
I raised a fix for the dashboard e2e: #55771 and as for the cephadm e2e, its mostly grafana related failures which will be gone when we have a new grafana image or it will go away when this PR gets merged (which removes the need of building grafana image whenever new grafana dashboards are delivered,. This PR is not affected by the dashboard or dashboard cephadm e2es |
|
@vshankar we could continue now :) |
Get mds_gid_t from up of MDSMap, will cause to core dump if target mds_rank_t does not exist up map:
from: src/mds/MDSMap.h
const auto& get_info(mds_rank_t m) const {
return mds_info.at(up.at(m));
}
reproduct:
up.at(m) will cause to core dump.
Fixes: https://tracker.ceph.com/issues/61844
Singed-off-by: Yite Gu yitegu0@gmail.com
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windows