add CRUSH_TUNABLES feature bit

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: fix usage for snap commands

Snap commands take '--snap <snapname> <imagename>'.

Signed-off-by: Sage Weil <sage@inktank.com>
Revert "rbd: fix usage for snap commands"

This reverts commit 42de6873f9ca33fc20e70176d9a422635a6f0152.

Actually, these are fine!  Dan made them all kinds of fancy.
mon: track pg creations by osd

Track the pending pg creations by osd, and use a helper to send out that
messages.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/mon: subscribe (onetime) to pg creations on connect

Ask the monitor for pending pg creations each time we connect.

Normally, this is a freebie check.  If there are pending creations, though,
it ensures that the OSD finds out about them even if the original lame
broadcast didn't reach it.  Specifically:

 - osd is hunting for a monitor, but isn't yet connected
 - new pgs are created
 - send_pg_creates() sends out create messages, but osd does get it
 - osd finally connects to a mon

Fixes: #2151 (tho the bug description is bad)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge branch 'next'

Conflicts:
	src/include/ceph_features.h
osd: defer boot if heartbeatmap indicates we are unhealthy

If the OSD is bogged down or unresponsive, we should not try to join
the cluster.  This was observed on congress (slow/clogged op_tp combined
with osdmap thrashing).

Fixes: #2502
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
osd: clean up boot method names

Prefix subsequent steps with _.  Better names.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
mon: shut up about sessionless MPGStats messages

If the mon gets a reset on the client connection, it clears the session
on the connection.  This is perfectly normal to see.

Signed-off-by: Sage Weil <sage@inktank.com>
os/HashIndex: use set<pair<string, hobject_t>> rather than multimap

Multimap does not make any guarantees about ordering of different
values with the same key.  list_by_hash, however, assumes that
the iterator order matches hobject_t order.  Thus, we use
set<pair<string, hobject_t> > to get the proper ordering.

Backport: stable

Signed-off-by: Samuel Just <sam.just@inktank.com>
objclass: add api calls to get/set xattrs

added the following functions:
  cls_cxx_getxattr
  cls_cxx_getxattrs
  cls_cxx_setxattr

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
cls_lock: objclass for advisory locking

Providing an objclass to create and manipulate advisory
locking. Also providing a client api to control it. A lock
may either be exclusively locked or shared among multiple
lockers. A locker is identified by the rados client name, and
by a cookie-string.
A lock may be assigned with a tag that every operation on that
lock should use. A lock can be unlocked by the client that locked
it, or may be broken by other clients.
When a non-zero lock duration is assigned to a lock by a locker,
that locker expires after that time duration.
A lock may have a description.
Locks on a specific object can be listed. Lockers of a specific
lock can be enumerated (by get_info).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rados tool: add advisory lock control commands

Can now lock, break lock, list locks and show lock
info.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rados: lock info keeps expiration, not duration

We pass duration in the request, but internally we keep
the expiration.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
cls_log: update a comment

Was missing output param description.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
cls_lock: document lock properties

Added some comments about different lock properties.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
cls_lock: cls_lock_id_t -> cls_lock_locker_id_t

Renamed type to make more sense.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
test/store_test.cc: verify collection_list_partial results are sorted

Synthetic test now also varies snapshots and uses a small variety of
hashes.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge branch 'next'
OpRequest,OSD: track recent slow ops

This should be helpful while investigating slow performance.

OpRequests now track events with timestamp in addition
to dumping them to the log.  OpHistory keeps up to a
configurable number of the slowest ops over a configurable
recent time interval.  The admin socket interface for the OSD
now has a dump_historic_ops command which dumps the stored
slow ops.

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>