Bug #42597
mon and mds ok-to-stop commands should validate input names exist to prevent misleading replies
Status:
New
Priority:
Normal
Assignee:
-
Category:
Administration/Usability
Target version:
-
% Done:
0%
Source:
Tags:
low-hanging-fruit
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Monitor
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Tags:
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
History
#1 Updated by Greg Farnum over 3 years ago
- Project changed from Ceph to RADOS
- Subject changed from mon and mds ok-to-stop commands do not validate inputs and produce misleading results to mon and mds ok-to-stop commands should validate input names exist to prevent misleading replies
- Category set to Administration/Usability
- Component(RADOS) Monitor added
#2 Updated by Neha Ojha over 3 years ago
- Tags set to low-hanging-fruit
#3 Updated by Laura Flores 8 months ago
- Tags set to low-hanging-fruit