This ensures we don't stall out waiting for a lock state to change.
This fixes ~4-5 second stalls easily reproducible and visible with
ceph-fuse and 'dbench 1'.
Signed-off-by: Sage Weil <sage@inktank.com>
The previous kludge where a waiting_for_session key indicated that we
had an open in progress was... kludgey.
Introduce some helpers to do the session creation/open.
Move the waiting list to be a session member, and clean up associated
code.
Signed-off-by: Sage Weil <sage@inktank.com>
This is mostly just shuffling argument types around. In a few cases we
now assert that the session actually exists; these would have also been
problematic before when we call get_inst() on bad addrs or something, or
silently ignored bugs.
Signed-off-by: Sage Weil <sage@inktank.com>
Bump the max before we run out of IDs to allocate. This avoids a stall in
authentication every N new clients.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Luis <joao.luis@inktank.com>
Simplify the logic a bit so it is easier to follow.
Small behavior change: we will successfully allocate and return a gid that
== the max when we can't bump it.
Signed-off-by: Sage Weil <sage@inktank.com>
This only happens on the Leader and leads to duplicate global_ids.
Fixes: #4285
Signed-off-by: Joao Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
When proposing an older value learned during recovery, we don't create
a queued proposal -- we go straight through Paxos. Therefore, when
finishing a proposal, we must be sure that we have a proposal in the queue
before dereferencing it, otherwise we will segfault.
Fixes: #4250
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Fixes: #4425
Backport: bobtail
Apparently, libcurl needs that in order to be thread safe. Side
effect is that if libcurl is not compiled with c-ares support,
domain name lookups are not going to time out.
Issue affected keystone.
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Return a string instead of 'char *' to avoid usage of std::string:c_str()
to return a 'char *' from get_state_name().
Returning result of c_str() from a function is dangerous since the
result gets (may) invalid after the related string object gets
destroyed or out of scope (which is the case with return). So you may
end up with garbage in this case.
Related warning from cppcheck:
[src/mon/Monitor.h:172]: (error) Dangerous usage of c_str(). The value
returned by c_str() is invalid after this call.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Prefer prefix ++operator for non-primitive types like iterators for
performance reasons. Prefix ++/-- operators avoid creating a temporary
copy.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Perform initialization of IntentLogNameFilter:prefix in initialization list
instead of constructor body.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>