osd/osd_types: add blocked_by to pg_stat_t

Signed-off-by: Sage Weil <sage@redhat.com>
rados: add {read,write}_ops to df json

Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@redhat.com>
when starting an OSD, pass in the cluster name

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
use  name in /var/lib/ceph paths

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
use cluster name when checking the host

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
osd/PG: populate pg_stats_t blocked_by

Keep a PG member for OSDs that current block us, and fill it into the
stats struct when we publish.  Use a vector<int> in pg_stats_t to limit the
overhead (memory, decoding) on this list once it is static.

Signed-off-by: Sage Weil <sage@redhat.com>
mon/OSDMonitor: clean up 'osd perf' command placement

This doesn't need an OSDMap; move it out of that block.

Signed-off-by: Sage Weil <sage@redhat.com>
mon/PGMap: s/osdid/osd/ in 'osd perf' plaintext heading

Signed-off-by: Sage Weil <sage@redhat.com>
mds: Make min/max UID configurable for who is allowed to create a snapshot

This way administrators can configure which UIDs are allowed to create
snapshots on CephFS.

In certain situations it might be desirable that regular users are not allowed
to create snapshots. For example on shared hosting environments.

Fixes: #9029
allow passing a --cluster flag to the init script

It will fallback to looking at /etc/ceph/$cluster.conf
otherwise.

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
make ceph-disk use the new init flag for cluster

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
mds: Also check min/max uid on snap removal

Not only check if the uid is correct when creating a snapshot, but also
verify if the UID is correct when trying to remove a snapshot.

Fixes: #9029
test_librbd_fsx: also flatten as part of randomize_parent_overlap

With randomize_parent_overlap fsx will randomly truncate base images
after they have been cloned from.  This throws flatten into the mix:
base image will be flattened with 2/16 chance (equal to the chance of
leaving the image intact).

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
osd/PG: set blocked_by during peering GetInfo

Signed-off-by: Sage Weil <sage@redhat.com>
osd/PG: set blocked_by during peering GetLog

Signed-off-by: Sage Weil <sage@redhat.com>
osd/PG: set blocked_by in Incomplete state

Signed-off-by: Sage Weil <sage@redhat.com>
osd/PG: set blocked_by in GetMissing

Signed-off-by: Sage Weil <sage@redhat.com>
mon/PGMap: track histogram of pg blocked_by

Signed-off-by: Sage Weil <sage@redhat.com>
mon: add 'osd blocked-by' command

Print a histogram of how many peers are blocked by each OSD.  This is
useful for quickly diagnosing which OSDs are broken or slow and preventing
peering from completing.

In the future, we can populate the pg_stat_t with peer OSDs for more than
just peering waits, but this is a useful start.

Signed-off-by: Sage Weil <sage@redhat.com>
qa/workunits/cephtool: add simple 'ceph osd perf' test

Signed-off-by: Sage Weil <sage@redhat.com>