osd/osd_types: add blocked_by to pg_stat_t

Signed-off-by: Sage Weil <sage@redhat.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>
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>
qa/workunits/cephtool: add trivial 'ceph osd blocked-by' test

Signed-off-by: Sage Weil <sage@redhat.com>
osd/PG: bound number of blocked_by OSDs we report per PG

We don't want to include an unbounded-sized vector of OSDs in the pg_stat_t
struct.  Cap it, and report a random subset of the actual blockers to fit
within the limit.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/osd_types: s/int/int32_t/ in pg_stat_t

Signed-off-by: Sage Weil <sage@redhat.com>
mon/Paxos: put source mon id in a temp variable

Signed-off-by: Sage Weil <sage@redhat.com>
rgw: copy object data if target bucket is in a different pool

Fixes: #9039
Backport: firefly

The new manifest does not provide a way to put the head and the tail in
separate pools. In any case, if an object is copied between buckets in
different pools, we may really just want the object to be copied, rather
than reference counted.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw: copy_obj_data() uses atomic processor

Fixes: #9089

copy_obj_data was not using the current object write infrastructure,
which means that the end objects weren't striped.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw: pass set_mtime to copy_obj_data()

Sometimes we need to set the mtime when copying object data (e.g., when
we rewrite the obj).

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw_admin: add --min-rewrite-stripe-size for object rewrite

A new param to check whether the object has requires restriping,
checking whether a specific object stripe is bigger than the specified
size. By default it is set to 0, and in that case it'll always be
restriped. Having it set to 4M + 1 will make sure that only the objects
that weren't striped before (using default settings) will be restriped.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw: disable civetweb url decoding

Fixes: #8621

We want to have the raw request uri, as we do the decoding ourselves.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>