Project

General

Profile

Actions

Bug #43193

closed

"ceph ping mon.<id>" cannot work

Added by Min Shi over 4 years ago. Updated 7 months ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

100%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The command "ceph ping mon.<id>" returns an error output:

$ sudo ceph ping mon.c3325
[errno 2] error calling ping_monitor

The command ”ceph ping mon.*" returns correct output.
This is caused by lacking connect to ceph cluster.
In ping_monitor function(src/ceph.in), for the command "ceph ping mon.*", it first connect to the ceph cluster and then execute this command.
But for the command with a mon id specified, it lacks connect operation.
def ping_monitor(cluster_handle, name, timeout):
    if 'mon.' not in name:
        print('"ping" expects a monitor to ping; try "ping mon.<id>"', file=sys.stderr)
        return 1

    mon_id = name[len('mon.'):]
    if mon_id == '*':
        run_in_thread(cluster_handle.connect, timeout=timeout)
        for m in monids():
            s = run_in_thread(cluster_handle.ping_monitor, m)
            if s is None:
                print("mon.{0}".format(m) + '\n' + "Error connecting to monitor.")
            else:
                print("mon.{0}".format(m) + '\n' + s)
    else:
            s = run_in_thread(cluster_handle.ping_monitor, mon_id)
            print(s)
    return 0


Related issues 1 (1 open0 closed)

Related to RADOS - Bug #44420: cephadm cluster: "ceph ping mon.*" works fine, but "ceph ping mon.<id>" is brokenFix Under ReviewMykola Golub

Actions
Actions

Also available in: Atom PDF