We don't need it after all. If we are in the middle of some proposal,
then we guarantee that said proposal is likely to be retried. If we
haven't yet proposed, then it's forever more likely that a client will
eventually retry the message that triggered this proposal.
Basically, this mechanism attempted at fixing a non-problem, and was in
fact triggering some unforeseen issues that would have required increasing
the code complexity for no good reason.
Fixes: #5102
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
By finishing these Contexts, we make sure the Contexts they enclose (to be
called once the proposal goes through) will behave as their were initially
planned: for instance, a C_Command() may retry the command if a -EAGAIN
is passed to 'finish_contexts', while a C_Trimmed() will simply set
'going_to_trim' to false.
This aims at fixing at least a bug in which Paxos will stop trimming if an
election is triggered while a trim is queued but not yet finished. Such
happens because it is the C_Trimmed() context that is responsible for
resetting 'going_to_trim' back to false. By clearing all the contexts on
the proposal list instead of finishing them, we stay forever unable to
trim Paxos again as 'going_to_trim' will stay True till the end of time as
we know it.
Fixes: #4895
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
CID 716997 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "MDSCacheObject::is_auth() const".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ID 716998 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "operator <<(std::ostream &, CInode &)".
CID 716998 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "MDCache::add_replica_dir(ceph::buffer::list::iterator &,
CInode *, int, std::list<Context *, std::allocator<Context *> > &)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 716999 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "in" when
calling "CInode::put_stickydirs()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 717000 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir" when
calling "operator <<(std::ostream &, CDir &)".
CID 717000 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir" when
calling "Migrator::import_reverse_unfreeze(CDir *)".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Move dout() calls behind the related asserts to prevent possible NULL
pointer dereference.
CID 717001 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "diri" when calling
"operator <<(std::ostream &, CInode
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Add asserts to solve these CID issues:
CID 717002 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir"
when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717002 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dir"
when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717003 (#1 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "dn" when
calling "operator <<(std::ostream &, CDentry &)"
CID 717003 (#2 of 2): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "straydn"
when calling "CDentry::push_projected_linkage()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1021212 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
copy_paste_error: "r" in "r = -*__errno_location()" looks like
a copy-paste error. Should it say "fd" instead?
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix for:
returned_null: Function "SessionMap::get_session(entity_name_t)" returns
null (checked 12 out of 14 times)
CID 739601 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null
"this->sessionmap.get_session(entity_name_t::CLIENT(client.v))" when
calling "MDS::send_message_client_counted(Message *, Session *)"
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Assert if 'cur' is NULL.
CID 966616 (#1 of 1): Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be null "cur" when
calling "CInode::is_dir()".
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Issues:
1) ignore commands with no help text, as does daemon help?
2) come up with daemon names from running config somehow
3) do we *want* to do all, always? Maybe
--help for 'normal' mon commands, mon daemon commands
--help-osd for osd tell, pg, osd daemon commands
--help-mds for mds daemon commands
--help-all for all the above
?
Signed-off-by: Dan Mick <dan.mick@inktank.com>
add cmddesc to all register_command calls, and add a class and
command to return all the command descriptors as is done for
monitor, osd tell, and pg pgid commands.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Remove ceph-legacy-cli
Include ceph in proper places to get it built/installed/packaged
Make ceph-common (deb) or ceph (rpm) pkg depend on python-ceph pkg
Signed-off-by: Dan Mick <dan.mick@inktank.com>
We want to see helptext from mon commands and osd commands (and,
eventually, daemon commands), and so we'll need to make several
calls for the command descriptors before we have all the help.
Wait until we know we've been asked for help before taking the
multiple-connection hit.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Return ENXIO instead of EINVAL, mostly because EINVAL is overused, but
also because we need to distinguish between this sort of failure
on 'get_command_descriptions' and 'old OSD'.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
'tell osd.n' and 'pg <pgid>' commands go directly to the OSD.
Both are enumerated in osd_commands[]; that could be cleaner but
it doesn't seem worth the effort.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Before even asking for a list of valid command signatures, do some fixed
parsing to figure out which daemon we should ask (and eventually send
the command to). For pg commands, just let the objecter's pg_command
figure out where they should go.
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Allow validation of the front of a command, to precalculate the
target for a command (basically, whether it's a 'normal' monitor
command, a "tell <osd>" command, or a "pg <pgid>" command; the latter
two go to the OSD, and so the OSD needs to be consulted for valid
command lists *and* receive the command directly. This means we
have to have some fixed preclassification of the command, which
is done with validate(partial=True).
Signed-off-by: Dan Mick <dan.mick@inktank.com>
It's also passed as part of the message, but to avoid having to
rev MCommand, just pass it in cmd there as well
Signed-off-by: Dan Mick <dan.mick@inktank.com>
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>