Handling SIGINT while blocked in librados() requires said blocking
to not block the main Python thread, so arrange for all entries
into librados to be done on a child thread. Loop polling join()
on that thread so that the main thread can see SIGINT.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
- boilerplate at the top
- reply and update labels
- default r == 0
- explicitly fall out invalid or unrecognized commands in final else block
Signed-off-by: Sage Weil <sage@inktank.com>
Convert all monitor users to use the new MonCap class.
Simplify the semantics around auids by essentially dropping any meaningful
permissions enforcement around them.
Signed-off-by: Sage Weil <sage@inktank.com>
We have changed MonCap encoding and command semantics (which affects
forwarding). Bump the wire protocol version.
Signed-off-by: Sage Weil <sage@inktank.com>
This is a new class with a new grammer. Implementation is modeled after
OSDCap, and the semantics are based on the old MonCaps, although somewhat
different (though not in too many important ways, I think).
Note that we complete drop auid support; the semantics for that were a
complete mess.
Signed-off-by: Sage Weil <sage@inktank.com>
Avoid implementing an operator<< on __u8, and make the naming less likely
to conflict with others.
We did a similar thing with MonCap.
Signed-off-by: Sage Weil <sage@inktank.com>
Only return true for the global "allow all" if the match does not constrain
us at all. This matches the set_allow_all() method.
Signed-off-by: Sage Weil <sage@inktank.com>
Add method to trail the cluster/monitor log for use by ceph -w. Add a
simple functional test.
Note that changing the subscription level does not currently work
due to the protocol; you can't cancel a subscriptions.
Signed-off-by: Sage Weil <sage@inktank.com>
These are helpful for commands that may have large results and are
expensive to process and/or transfer because retrying very inefficient.
The caller is expected to free(3) the result.
Signed-off-by: Sage Weil <sage@inktank.com>
ceph is a new Python CLI that:
1) queries the underlying cephbin to get command descriptors,
2) parses user input and validates everything possible,
3) passes validated JSON command to cephbin for handling
The frontend also presents help, and takes over the CLI command
looping mode.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Conflicts:
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
Use json_spirit to read/parse JSON command input into a "cmdmap",
which is a boost::variant typechecked discriminant union.
This means that requests to read from the map must match the type
given. Types are string, bool, int64_t, double, and vector<string>,
and that type is a "cmd_vartype"; a cmdmap is a map of name (string) to
cmd_vartype.
Also, an evolutionary deadend hack "build_fullcmd()", which reassembles
certain commands from the cmdmap back into a string for the sole reason
of running them through _allowed_command. This is due to be replaced by
a better allow mechanism very shortly.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
- move #includes to str_list.h
- remove redundant std::, add using for vector, set, list
- add get_str_vec and get_str_set-no-delims
Signed-off-by: Dan Mick <dan.mick@inktank.com>
This is reimplementing the 'tell osd' and 'pg ...' commands in the ceph
tool in the Objecter infrastruture. As a result we are forced to consider
all of the corner cases we have already handled for regular ops and
linger ops, so the result should be significantly more robust.
Signed-off-by: Sage Weil <sage@inktank.com>
If we get an ack with no tid, we have to assume it is the first (hopefully
only) command we have in flight. Old code doesn't properly set the tid.
Signed-off-by: Sage Weil <sage@inktank.com>
Set the tid on the reply to match the request. This will allow a client
to have multiple commands in flight.
Signed-off-by: Sage Weil <sage@inktank.com>