Bug #4261
closedinjectargs can't parse boolean values correctly
0%
Description
The issue wasn't quickly evident after a quick skim of the code, but this report came in on ceph-users (for bobtail) and I reproduced it on my local box (with master).
ceph --keyfile admin osd tell \* injectargs "--filestore-flusher 0"
2013-02-25 11:05:59.112463 7f23ac1a9710 1 -- 192.168.106.225:6800/2670 <== mon.0 192.168.106.225:6789/0 25 ==== mon_command(injectargs --filestore-flusher 0 v 5) v1 ==== 77+0+0 (583503655 0 0) 0x2a31400 con 0x29f79a0 2013-02-25 11:05:59.112483 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:05:59.112488 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:05:59.112491 7f23ac1a9710 20 osd.0 5 _dispatch 0x2a31400 mon_command(injectargs --filestore-flusher 0 v 5) v1 2013-02-25 11:05:59.112499 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:05:59.112502 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:05:59.112543 7f23a599c710 20 osd.0 5 do_command tid 0 [injectargs,--filestore-flusher 0] 2013-02-25 11:05:59.112921 7f23a599c710 0 osd.0 5 do_command r=0 failed to parse arguments: 0 filestore_flusher = 'true'
./ceph osd tell \* injectargs "--filestore-flusher=0"
2013-02-25 11:06:21.332346 7f23ac1a9710 1 -- 192.168.106.225:6800/2670 <== mon.0 192.168.106.225:6789/0 28 ==== mon_command(injectargs v 5) v1 ==== 52+0+0 (1640974214 0 0) 0x30bee00 con 0x29f79a0 2013-02-25 11:06:21.332377 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:06:21.332383 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:06:21.332386 7f23ac1a9710 20 osd.0 5 _dispatch 0x30bee00 mon_command(injectargs v 5) v1 2013-02-25 11:06:21.332416 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:06:21.332422 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:06:21.332468 7f23a599c710 20 osd.0 5 do_command tid 0 [injectargs] 2013-02-25 11:06:21.332478 7f23a599c710 0 osd.0 5 do_command r=-22 ignoring empty injectargs 2013-02-25 11:06:21.332486 7f23a599c710 0 log [INF] : ignoring empty injectargs
./ceph osd tell \* injectargs "--filestore-flusher false"
2013-02-25 11:06:44.176805 7f23ac1a9710 1 -- 192.168.106.225:6800/2670 <== mon.0 192.168.106.225:6789/0 30 ==== mon_command(injectargs --filestore-flusher false v 5) v1 ==== 81+0+0 (376026484 0 0) 0x30bec00 con 0x29f79a0 2013-02-25 11:06:44.176824 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:06:44.176827 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:06:44.176828 7f23ac1a9710 20 osd.0 5 _dispatch 0x30bec00 mon_command(injectargs --filestore-flusher false v 5) v1 2013-02-25 11:06:44.176834 7f23ac1a9710 10 osd.0 5 do_waiters -- start 2013-02-25 11:06:44.176836 7f23ac1a9710 10 osd.0 5 do_waiters -- finish 2013-02-25 11:06:44.176856 7f23a599c710 20 osd.0 5 do_command tid 0 [injectargs,--filestore-flusher false] 2013-02-25 11:06:44.177218 7f23a599c710 0 osd.0 5 do_command r=0 failed to parse arguments: false filestore_flusher = 'true' 2013-02-25 11:06:44.177229 7f23a599c710 0 log [INF] : failed to parse arguments: false 2013-02-25 11:06:44.177232 7f23a599c710 0 log [INF] : filestore_flusher = 'true'
Updated by Sage Weil about 11 years ago
--no-foo, or --foo=0
the problem with your #2 is the cli is parsing it. add a space inside the quotes
Updated by Josh Durgin about 11 years ago
or more consistently with other tools, use
--to stop parsing before the args you want to inject.
Updated by Josh Durgin about 11 years ago
To be explicit, 'ceph osd tell \* -- --filestore-flusher=false' works.
There is a bug here though: parsing boolean options is different with injectargs than with the config file. 1 and 0 get turned into 'true' and 'false' (and true and false are case-insensitive) in the config file, whereas injectargs only accepts 'true' or 'false' for boolean options.
Updated by Danny Al-Gaaf about 11 years ago
see https://github.com/ceph/ceph/pull/80 for a fix to accept also 0/1 for boolean options on injectargs.