This lets us set a higher limit on messages from daemons (osd, mds) than
from clients, and throttle them independently.
Fixes: #2942
Signed-off-by: Sage Weil <sage@inktank.com>
Log banner from global_init(). This puts it at the very top of the log,
right when the daemon starts.
Fixes: #2940
Signed-off-by: Sage Weil <sage@inktank.com>
This is an imperfect check in that tunables may be set in past osdmaps,
and the OSDs may need that in order to peer correctly. However, in the
general case, this will catch most users. In particular, it will catch
- set tunables
- nothing works (osds or clients lack feature)
- reset/clear tunables
- things recover
But not
- set tunables
- osds have feature, behave
- new osds with old code added, lack feature
- remove tunables
- new osds may fail to peer properly because they lack the feature
Signed-off-by: Sage Weil <sage@inktank.com>
If the current crush map has non-default tunables, set our messengers to
require the tunables feature bit. If it does not, clear the bit.
Signed-off-by: Sage Weil <sage@inktank.com>
Before we were associating the throttler with a CLIENT specific policy
that didn't cover MDS. That's silly. Instead, associate the throttler
with the default policy (which is now possible).
Signed-off-by: Sage Weil <sage@inktank.com>
Add locking in set_policy_throttler.
Also, make it act on the default policy when the specified type does not
have a sepcific policy set for it.
Signed-off-by: Sage Weil <sage@inktank.com>
Introduce a policy_lock in SimpleMessenger to make this safe even after
the messenger has been started up. The user needs to be aware that
policy changes will not affect connections that are already established.
Signed-off-by: Sage Weil <sage@inktank.com>
This needs to be provided to the Accepter at bind time, not by start().
Otherwise the nonce is effectively always 0, which is useless and breaks
all sorts of things. Broken by 8453a8198c.
Signed-off-by: Sage Weil <sage@inktank.com>
If we are waiting for an osdmap for a command, track that explicitly so
that we know when to retry send_command().
Signed-off-by: Sage Weil <sage@inktank.com>
We only discard outgoing messages; incoming messages are handled by the
IncomingQueue.. but this method doesn't touch that.
Signed-off-by: Sage Weil <sage@inktank.com>
Normally we never go from need_addr == false to need_addr == true.
It always starts out as true, so this else is useless on the first
call to Accepter::bind().
The only exception is rebind(). Add an unlearn_addr() that will clear
need_addr. This is almost unnecessary, but doing so fixes a small bug
where the local_connection->peer_addr doesn't get updated when we do a
rebind().
Drop now-unused set_need_addr(). We keep get_need_addr() only because
it is useful in the debug output and for the assert.
Signed-off-by: Sage Weil <sage@inktank.com>
If we 'ceph tell <foo> ...' to a non-monitor, we need to send keepalives to
ensure we detect a tcp drop. (Not so for monitors; monclient already does
its own keepalive thing.)
Signed-off-by: Sage Weil <sage@inktank.com>
send_command() was blocking for the osdmap, and also called from the
connect callback. Instead, re-call it from the handle_osd_map() callback
so that it never blocks.
This was easy to trigger with 'ceph osd tell osd.0 foo' and ms failure
injection.
Signed-off-by: Sage Weil <sage@inktank.com>
If mon_host fails to parse, return an error instead of success.
This avoids failing later on an assert monmap.size() > 0 in the
monmap in MonClient.
Fixes: #2913
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>