Project

General

Profile

Actions

Bug #42597

open

mon and mds ok-to-stop commands should validate input names exist to prevent misleading replies

Added by Nathan Fish over 4 years ago. Updated 5 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
-
Category:
Administration/Usability
Target version:
-
% Done:

0%

Source:
Tags:
low-hanging-fruit
Backport:
quincy,reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDSMonitor
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

"ceph osd ok-to-stop" accepts only integers, "any", and "all". However, the "mon" and "mds" versions accept any string, regardless of whether it is a valid daemon name. They then say that everything will be fine:

root@dc-3558-422:~# ceph mon stat
e1: 3 mons at {dc-3558-422=[v2:10.1.152.122:3300/0,v1:10.1.152.122:6789/0],m3-3101-422=[v2:10.1.155.122:3300/0,v1:10.1.155.122:6789/0],mc-3015-422=[v2:10.1.154.122:3300/0,v1:10.1.154.122:6789/0]}, election epoch 31318, leader 0 dc-3558-422, quorum 0,1,2 dc-3558-422,mc-3015-422,m3-3101-422

# Numeric id isn't recognized
root@dc-3558-422:~# ceph mon ok-to-stop 0
quorum should be preserved (dc-3558-422,m3-3101-422,mc-3015-422) after stopping [0]

# Missing a character
root@dc-3558-422:~# ceph mon ok-to-stop dc-3558-42
quorum should be preserved (dc-3558-422,m3-3101-422,mc-3015-422) after stopping [dc-3558-42]

# all?
root@dc-3558-422:~# ceph mon ok-to-stop all
quorum should be preserved (dc-3558-422,m3-3101-422,mc-3015-422) after stopping [all]

# mds is the same:
root@dc-3558-422:~# ceph mds ok-to-stop all
should be safe to stop [all]

root@dc-3558-422:~# ceph mds ok-to-stop 0
should be safe to stop [0]

The mon and mds ok-to-stop commands are therefore not very safe. "ceph mon ok-to-rm" does seem to validate mon names:

root@dc-3558-422:~# ceph mon ok-to-rm 0
mon.0 does not exist

root@dc-3558-422:~# ceph mon ok-to-rm all
mon.all does not exist

root@dc-3558-422:~# ceph mon ok-to-rm foo
mon.foo does not exist
Actions

Also available in: Atom PDF