crush: add helper has_nondefault_tunables()

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: expose get_policy() through generic Messenger API

Return a copy instead of a const reference, too...

Signed-off-by: Sage Weil <sage@inktank.com>
doc: v0.48.1argonaut release notes, changelog

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: make set_policy() and set_default_policy() safe to re-use

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>
msgr: make set_policy_throttler safe, act on default

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>
osd: put throttler on default policy

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>
osd: require CRUSH_TUNABLES feature of peers, clients when used

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>
mon: require CRUSH_TUNABLES when latest osdmap has tunables set

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>
doc: document use of CRUSH tunables

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'wip-crush-tunables'

Reviewed-by: Greg Farnum <greg@inktank.com>
global: fix version banner in log on startup

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>
perfcounters: add u64 average type

Signed-off-by: Sage Weil <sage@inktank.com>
filejournal: instrument journal write counts, sizes

This rounds out the low-hanging fruit that are coming to mind.  Moving on.

Fixes: #2619
Signed-off-by: Sage Weil <sage@inktank.com>
mon: throttle daemon messages independently from client messages

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>
global: only print banner if type is daemon

Signed-off-by: Sage Weil <sage@inktank.com>
osdmap: fix pg_num calculation when generating osdmap from conf

Base num_pg calculation on the number of osds, not the max osd id.

Fixes: #2918
Signed-off-by: Sage Weil <sage@inktank.com>
osdmap: apply mon_max_osd when generating osdmap from conf

This prevents users from having an [osd.1234567] section and blowing up
their memory usage.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'wip-2918'

Reviewed-by: Dan Mick <dan.mick@inktank.com>