| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
[src/mon/MonClient.h:412]: (performance) Function parameter 'mon_name'
should be passed by reference.
Changed also parameter name in function implementation to match name
in declaration.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
|
|\
| |
| |
| |
| | |
Improve the OSD and generic monitor timeout mechanisms
Reviewed-by: Sage Weil <sage@inktank.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the monitors are systematically slowing down, we don't want to spam
them with reconnect attempts every three seconds. Instead, every time
we issue a reconnect, multiply our timeout period by a configurable; when
we complete the connection, reduce that multipler by 50%. This should let
us respond to monitor load.
Of course, we don't want to do that for initial startup in the case of a
couple down monitors, so don't apply the backoff until we've successfully
connected to a monitor at least once.
Signed-off-by: Greg Farnum <greg@inktank.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Then the callback is triggered when a new session is established, and the
daemon can do whatever it likes. There are no guarantees about how long it
might take to trigger, though. In particular we call the provided callback
while not holding our own lock in order to avoid deadlock. This could lead
to some funny ordering from the user's perspective if they call
reopen_session() again before getting the callback, but there's no way around
that, so they just have to use it appropriately.
Signed-off-by: Greg Farnum <greg@inktank.com>
|
|\ \
| |/
|/|
| |
| | |
Improve OSD subscription handling
Reviewed-by: Sage Weil <sage@inktank.com>
|
| |
| |
| |
| |
| |
| |
| | |
Provide a subscription-modifying function which will not decrement
the start version.
Signed-off-by: Greg Farnum <greg@inktank.com>
|
|/
|
|
|
|
| |
Just use the conf option directly, since librados is the only caller.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
|
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
|
|
|
|
| |
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
|
|
|
|
|
|
| |
Keep consistency in the code to not generate warnings of this type.
Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
|
|\
| |
| | |
Reviewed-by: Samuel Just <sam.just@inktank.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make RefCountedObject a private parent of Connection so that users are
forced to use ConnectionRef whenever references are taken.
Many methods can still take a raw Connection* when they are using the
caller's reference but not taking their own; this is cheaper than
twiddling the reference count, and the lifetime is still well defined.
Local variables generally use ConnectionRef, though.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|/
|
|
|
|
|
|
| |
This implementation is limited: we direct our command by reopening
a session with the specific monitor. If there is more than one of these
queued we will fail to reach either.
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>
|
|
|
|
|
|
|
| |
Reimplement the ceph tool functionality to set a command to the monitor
and collect a response.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
|
| |
This avoids the situation where a librados or other user with the default
of 'cephx,none' and no keyring is authenticating against a cluster with
required of 'none' and an annoying warning is generated every time. Now
we only print a helpful message if we actually failed.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
| |
Avoid using shared-state rand() when picking monitors. This way we don't
screw with library users like test_librbd_fsx that rely on srand() and
rand() being deterministic.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|\
| |
| |
| |
| |
| | |
Conflicts:
src/common/config_opts.h
Added a couple of options related to session authentication, accepted new values for option from master
|
| |
| |
| |
| |
| |
| | |
where they're needed.
Signed-off-by: Peter Reiher <reiher@inktank.com>
|
|/
|
|
|
|
| |
Any sensible caller probably wants to use get_version() directly.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
| |
If our map get_version check needs to be retried, tell the
is_latest_map() callers instead of giving returning 0 ("no").
Fixes: #3049
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
| |
Return -EAGAIN instead of -1, since that's more meaningful, and
document it.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
| |
Immediately send more log messages if we had more when the first set was
sent. Otherwise, wait until the next tick to check. This semi-throttles
logging based on how much the monitor can handle.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
|
|
| |
Let MonClient and Monitor handle delivery of messages. This puts them in
control and lets them trigger sending of more messages when we have a
bunch queued.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
|
|
| |
This belongs here, not in MonClient.
Signed-off-by: Sage Weil <sage@inktank.com>
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
|
|
| |
Use AuthSupported class instead of repopulating it ourselves.
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The addition of a Finisher in 9c56070bc20878e87fcb4715b0a3559dd1aaf9ff
broke shutdown in the case where MonClient::init() was never called, so
add a guard variable to keep track.
I'm not sure this is actually the best solution (Timer guard itself,
for instance; maybe Finisher should too?), but I don't want to change
the Finisher interface without looking at it more carefully than I'm
going to right now.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
|
|
|
|
|
|
| |
Otherwise we can deadlock if any completions call back into MonClient.
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
|
|
|
| |
Reimplement is_latest_map() in terms of more general helper. Add field
to reply message.
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
| |
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
|
|
|
|
| |
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
|
|
|
|
| |
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
|
|
|
|
| |
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MonClient should contain a KeyRing and a RotatingKeyRing. All the
MonClient users, except possibly csyn, don't want to manage those
objects themselves.
Don't chdir until after we have opened the KeyRing. If the KeyRing is at
a relative path, a chdir may make it inaccessible. Separate the chdir
function from the daemonize function.
Refactor the cmds argument parsing a little bit. Separate the special
actions from the normal operations of the daemon.
This should allow librados and libceph to support CephX finally! yay!
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a lossless session with the monitor! Only send log entries once.
Otherwise, if the mon is down or something, we end up building up a HUGE
backlog of requests by resending the same messages over and over again.
To do this:
- keep track of which entire we've sent.
- reset when the session resets
- let the MonClient control when log entries are sent, and reset
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Maintain an explicit Connection handle to send messages and mark_down old
monitor connections. Ignore any incoming message that is not part of that
session. This fixes problems with incoming messages that race with
session restarts.
Fixes: #1033
Reported-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
| |
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
|
|
|
|
| |
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
|
|
|
|
| |
Signed-off-by: Sage Weil <sage@newdream.net>
|
|
|
|
| |
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rework Timer and SafeTimer to be more efficient and to handle shutdown
correctly. Document the API, especially what locks need to held where.
The destructor for both Timer and SafeTimer now joins the timer thread
safely. The shutdown() function is available to callers who want to join
it before the Timer is destroyed.
To make things more efficient, don't create a new std::set every time we
insert a Context. Use multimap instead. Don't signal the condition
variable unless the event we have insert comes before all the other
events in the scheduled map. Don't allocate an extra Context in
SafeTimer.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
|
|
|
|
|
|
| |
Make print_summary, print, dump, etc. functions const methods.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/cmon.cc
src/include/ceph_fs.h
src/mon/MonClient.cc
src/mon/Monitor.cc
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before, we would provide "have" and a bool "onetime" flag. The struct was
also screwed up with an extra __le64. Then have=0 was a special case
that meant "give me the latest".
The problem is this is ambiguous between the usual "give me everything
since X" and "give me your latest", because you might actually have 0 and
want 1..current.
Changes protocol and cleans up the struct:
- now "start" and "flags", where only 1 flag (ONETIME) is defined
- clean up sub_want_* methods throughout
- fix all sub_want callers to ask for _start_ (not have) epoch, or 0 for
any/latest
- add a feature bit; talks old clients w/o that bit
Signed-off-by: Sage Weil <sage@newdream.net>
|
| |
| |
| |
| |
| |
| | |
3s for hunt rate, 10s for ping rate.
Signed-off-by: Sage Weil <sage@newdream.net>
|
| |
| |
| |
| |
| |
| |
| | |
A couple of preprocessor symbols for include guards tampered with the reserved namespace.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sage Weil <sage@newdream.net>
|
| | |
|
|/ |
|