Skip to content

mon/MDSMonitor: rectify errmsg for "mds fail" cmd#57380

Closed
rishabh-d-dave wants to merge 1 commit intoceph:mainfrom
rishabh-d-dave:mds-fail-errmsg
Closed

mon/MDSMonitor: rectify errmsg for "mds fail" cmd#57380
rishabh-d-dave wants to merge 1 commit intoceph:mainfrom
rishabh-d-dave:mds-fail-errmsg

Conversation

@rishabh-d-dave
Copy link
Contributor

@rishabh-d-dave rishabh-d-dave commented May 9, 2024

Rectify the error message printed when a non-existent MDS's name is
passed to "ceph mds fail" command.

Fixes: https://tracker.ceph.com/issues/65875
Signed-off-by: Rishabh Dave ridave@redhat.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. "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

@rishabh-d-dave
Copy link
Contributor Author

rishabh-d-dave commented May 15, 2024

@ceph/cephfs @vshankar @batrick PTAL.

Copy link
Contributor

@chrisphoffman chrisphoffman left a comment

Choose a reason for hiding this comment

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

In the case you mention, that errmsg message does look weird, nice catch.

If you remove this output, what about the other instances when gid_from_arg() is called and fails in the same way, it now loses this errmsg.

See:
./bin/ceph mds freeze zzz yes

Copy link
Member

@batrick batrick left a comment

Choose a reason for hiding this comment

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

After this change, ss would be an unused argument. I think it does make sense to keep the error message here but perhaps the caller should be a little smarter about clearing ss if it doesn't care if the mds does not exist. For example:

continue;

should just either not pass ss (make it a pointer) or clear it before continue;.

@github-actions
Copy link

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 Jul 28, 2024
Rectify the error message printed when a non-existent MDS's name is
passed to "ceph mds fail" command.

Fixes: https://tracker.ceph.com/issues/65875
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Copy link
Member

@joscollin joscollin left a comment

Choose a reason for hiding this comment

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

In the case you mention, that errmsg message does look weird, nice catch.

If you remove this output, what about the other instances when gid_from_arg() is called and fails in the same way, it now loses this errmsg.

See: ./bin/ceph mds freeze zzz yes

diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index 76a57ac443d..7899a2146c6 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -1410,7 +1410,7 @@ mds_gid_t MDSMonitor::gid_from_arg(const FSMap &fsmap, const string &arg, ostrea
     const MDSMap::mds_info_t *mds_info = fsmap.find_by_name(arg);
     if (!mds_info) {
       ss << "MDS named '" << arg
-        << "' does not exist, or is not up";
+        << "' does not exist, or is not up or you lack the permission to see.";
       return MDS_GID_NONE;
     }
     dout(10) << __func__ << ": resolved MDS name '" << arg
@@ -1600,8 +1600,6 @@ int MDSMonitor::filesystem_command(
     MDSMap::mds_info_t failed_info;
     mds_gid_t gid = gid_from_arg(fsmap, who, ss);
     if (gid == MDS_GID_NONE) {
-      ss << "MDS named '" << who << "' does not exist, is not up or you "
-        << "lack the permission to see.";
       return 0;
     }
     if(!fsmap.gid_exists(gid, op->get_session()->get_allowed_fs_names())) {

This^ fixes the issue @chrisphoffman mentioned.

@vshankar
Copy link
Contributor

@rishabh-d-dave ping?

@vshankar
Copy link
Contributor

(waiting for @rishabh-d-dave to update)

@rishabh-d-dave
Copy link
Contributor Author

This one is on comparativley lower priority compared to mgr/vol PRs and certain BZs. I'll get back to it as soon my work on some of these is complete.

@joscollin
Copy link
Member

@rishabh-d-dave ping

@github-actions
Copy link

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
Copy link

github-actions bot commented Apr 9, 2025

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 Apr 9, 2025
@github-actions
Copy link

github-actions bot commented May 9, 2025

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions
Copy link

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 Jul 11, 2025
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Aug 10, 2025
@github-actions github-actions bot removed the stale label Sep 18, 2025
@github-actions
Copy link

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.

@vshankar
Copy link
Contributor

vshankar commented Jan 7, 2026

Closing it since its a minor cleanup and nothing urgent or super important.

@vshankar vshankar closed this Jan 7, 2026
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