summaryrefslogtreecommitdiffstats
path: root/src/mon/MonClient.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* MonClient: pass function parameter by referenceDanny Al-Gaaf2014-02-191-1/+1
| | | | | | | | | | [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>
* Merge pull request #1227 from ceph/wip-7394Gregory Farnum2014-02-181-1/+15
|\ | | | | | | | | Improve the OSD and generic monitor timeout mechanisms Reviewed-by: Sage Weil <sage@inktank.com>
| * monc: backoff the timeout period when reconnectingGreg Farnum2014-02-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * monc: let users specify a callback when they reopen their monitor sessionGreg Farnum2014-02-131-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #1223 from ceph/wip-7395Sage Weil2014-02-161-0/+16
|\ \ | |/ |/| | | | | Improve OSD subscription handling Reviewed-by: Sage Weil <sage@inktank.com>
| * monc: new fsub_want_increment( function to make handling subscriptions easierGreg Farnum2014-02-151-0/+16
| | | | | | | | | | | | | | Provide a subscription-modifying function which will not decrement the start version. Signed-off-by: Greg Farnum <greg@inktank.com>
* | MonClient: add a timeout on commands for libradosJosh Durgin2014-02-101-2/+14
|/ | | | | | Just use the conf option directly, since librados is the only caller. Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
* mon/MonClient: constify inbl command argsSage Weil2013-12-061-3/+3
| | | | | Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
* mon: MonClient: allow pinging a monitor without authenticating firstJoao Eduardo Luis2013-10-231-0/+64
| | | | Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
* Fix compilation -Wmismatched-tags warningsChristophe Courtaut2013-08-091-2/+2
| | | | | | Keep consistency in the code to not generate warnings of this type. Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
* Merge pull request #356 from ceph/wip-leaksSage Weil2013-06-141-1/+1
|\ | | | | Reviewed-by: Samuel Just <sam.just@inktank.com>
| * msgr: use ConnectionRef throughoutSage Weil2013-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mon/MonClient: send commands to a specific monitorSage Weil2013-06-131-3/+16
|/ | | | | | | | 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>
* librados: add rados_monitor_log()Sage Weil2013-05-221-0/+7
| | | | | | | | | | 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>
* mon/MonClient: add mon command handlingSage Weil2013-05-221-0/+32
| | | | | | | Reimplement the ceph tool functionality to set a command to the monitor and collect a response. Signed-off-by: Sage Weil <sage@inktank.com>
* monc: only warn about missing keyring if we fail to authenticateSage Weil2012-12-211-0/+1
| | | | | | | | | 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>
* mon/MonClient: use thread-safe RNG for picking monitorsSage Weil2012-11-181-0/+5
| | | | | | | | 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>
* Merge branch 'wip-msgauth4'Peter Reiher2012-10-261-0/+7
|\ | | | | | | | | | | Conflicts: src/common/config_opts.h Added a couple of options related to session authentication, accepted new values for option from master
| * Compatibility code for session authentication; mostly passing keys around to ↵Peter Reiher2012-10-011-0/+7
| | | | | | | | | | | | where they're needed. Signed-off-by: Peter Reiher <reiher@inktank.com>
* | monclient: drop now-unused MonClient::is_latest_map()Sage Weil2012-10-171-10/+0
|/ | | | | | Any sensible caller probably wants to use get_version() directly. Signed-off-by: Sage Weil <sage@inktank.com>
* monclient: pass EAGAIN to is_latest_map() callersSage Weil2012-08-281-0/+8
| | | | | | | | 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>
* monclient: document get_version(), and fix return valueSage Weil2012-08-281-0/+10
| | | | | | | Return -EAGAIN instead of -1, since that's more meaningful, and document it. Signed-off-by: Sage Weil <sage@inktank.com>
* auth: AuthSupported -> AuthMethodListSage Weil2012-07-301-2/+2
| | | | Signed-off-by: Sage Weil <sage@inktank.com>
* monclient: send more log entries when first set is ackedSage Weil2012-06-061-1/+2
| | | | | | | | 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>
* logclient: not a dispatcherSage Weil2012-06-061-0/+1
| | | | | | | | 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>
* monmap: move build_initial() from MonClientSage Weil2012-05-191-2/+0
| | | | | | This belongs here, not in MonClient. Signed-off-by: Sage Weil <sage@inktank.com>
* use libuuid for fsidSage Weil2011-11-121-1/+1
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* monclient: simplify auth_supported setSage Weil2011-11-051-1/+2
| | | | | | Use AuthSupported class instead of repopulating it ourselves. Signed-off-by: Sage Weil <sage@newdream.net>
* monclient: add an initialized bool to guard shutdown.Greg Farnum2011-10-051-0/+1
| | | | | | | | | | | | | 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>
* monclient: use an async finisherSage Weil2011-10-041-0/+2
| | | | | | Otherwise we can deadlock if any completions call back into MonClient. Signed-off-by: Sage Weil <sage@newdream.net>
* monclient: implement get_version() to get newest _and_ oldest map versionsSage Weil2011-10-041-2/+3
| | | | | | | Reimplement is_latest_map() in terms of more general helper. Add field to reply message. Signed-off-by: Sage Weil <sage@newdream.net>
* monclient: add method to retrieve the latest version of a mapJosh Durgin2011-07-301-0/+18
| | | | Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
* MonClient: deglobalizeColin Patrick McCabe2011-06-211-1/+1
| | | | Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
* mon/MonClient: use ldout instead of doutColin Patrick McCabe2011-06-211-1/+0
| | | | Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
* Dispatcher should take a CephContext argumentColin Patrick McCabe2011-06-101-18/+1
| | | | Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
* Refactor MonClient, KeyRingColin Patrick McCabe2011-06-031-3/+12
| | | | | | | | | | | | | | | | | 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>
* logclient: send entries once per mon sessionSage Weil2011-05-181-1/+8
| | | | | | | | | | | | | 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>
* monclient: maintain explicit session connection; ignore stray messagesSage Weil2011-05-111-0/+2
| | | | | | | | | | | 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>
* rbd: add commands for manipulating the kernel sysfs interfaceJosh Durgin2011-04-221-0/+2
| | | | Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
* monclient: fix leak of AuthClientHandlerJosh Durgin2011-03-141-2/+1
| | | | Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
* timer: make init/shutdown explicitSage Weil2010-11-151-1/+2
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* MonClient: start SafeTimer in MonClient::init()Colin Patrick McCabe2010-11-041-3/+3
| | | | Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
* Timer: fix timer shutdown, efficiency issuesColin Patrick McCabe2010-11-041-1/+2
| | | | | | | | | | | | | | | | | 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>
* mon: const crusadeColin Patrick McCabe2010-10-091-2/+6
| | | | | | Make print_summary, print, dump, etc. functions const methods. Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
* Merge branch 'unstable' into mon-removeSage Weil2010-07-291-23/+16
|\ | | | | | | | | | | | | | | Conflicts: src/cmon.cc src/include/ceph_fs.h src/mon/MonClient.cc src/mon/Monitor.cc
| * mon: revamp subscribe protocol [backward compatible protocol change]Sage Weil2010-07-271-22/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * monc: make hunt, ping rates configurationSage Weil2010-07-081-0/+1
| | | | | | | | | | | | 3s for hunt rate, 10s for ping rate. Signed-off-by: Sage Weil <sage@newdream.net>
| * Bug #98: Unique names for include guardsMarkus Elfring2010-06-171-2/+2
| | | | | | | | | | | | | | 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>
* | monclient: track cur_mon by name, not rankSage Weil2010-06-091-2/+2
| |
* | mon: identify monitors by name, not rankSage Weil2010-06-091-2/+2
|/