cls_rgw_client.cc: reduce scope of local variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw_admin.cc: fix same expression on both sides of '||'

Remove twice listed checks, get checks in alphabetical order,
added comment above the checks to point out to keep it in
alphabetical order to avoid double checks.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_bucket.cc: remove unused local variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw_bucket.cc: don't return bool if return value is int

Fix minor style issue: if the function return value is an integer
don't return bool values.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_bucket.cc: return result of function calls

Return the result of rgw_(un)link_bucket()/ from
RGWBucketMetadataHandler::put() to signal errors correctly to
the function caller.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rest.cc: fix malloc memory leak

Free with malloc allocated memory in error case before return.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rados.cc: use static_cast instead of C-Style cast

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_op.cc: reduce scope of local 'ret' integer variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rest_s3.cc: fix dereferencing after deallocation

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ReplicatedPG: replace clean_up_local with a debug check

Stray objects should have been cleaned up in the merge_log
transactions.  Only on the primary have those operations
necessarily been flushed at activate().

Fixes: 5084
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
PG: start flush on primary only after we process the master log

Once we start serving reads, stray objects must have already
been removed.  Therefore, we have to flush all operations
up to the transaction writing out the authoritative log.
On replicas, we flush in Stray() if we will not eventually
be activated and in ReplicaActive if we are in the acting
set.  This way a replica won't serve a replica read until
the store is consistent.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
qa/workunits/cephtool/test.sh: test 'osd create <uuid>'

Make sure it gives us back the same id.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
osd: include op queue age histogram in osd_stat_t

This includes a simple power-of-2 histogram of op ages in the op queue
inside osd_stat_t.  This can be used for a coarse view of overall cluster
performance (it will get summed by the mon), to identify specific outlier
osds who have a higher latency than the others, or to identify stuck ops.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
mon: make 'health' warn about slow requests

Currently we see slow request warnings go by in the cluster log, but they
are not reflected by 'ceph health'.  Use the new op queue histograms to
raise a flag there as well.

For example:

HEALTH_WARN 59 requests are blocked > 32 sec; 2 osds have slow requests
21 ops are blocked > 65.536 sec
38 ops are blocked > 32.768 sec
16 ops are blocked > 65.536 sec on osd.1
23 ops are blocked > 32.768 sec on osd.1
5 ops are blocked > 65.536 sec on osd.2
15 ops are blocked > 32.768 sec on osd.2
2 osds have slow requests

Fixes: #5505
Signed-off-by: Sage Weil <sage@inktank.com>
rgw: drop unused assignment

rgw/rgw_rados.cc: In member function 'virtual int RGWPutObjProcessor_Atomic::handle_data(ceph::bufferlist&, off_t, void**)':
rgw/rgw_rados.cc:648:5: warning: parameter 'ofs' set but not used [-Wunused-but-set-parameter]

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Merge pull request #444 from ceph/wip-osd-latency

osd: include op queue age histogram in osd_stat_t

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
mon: fix off-by-one in check for when sync falls behind

This is what e213b1bc25a212ffe42623c1d4b4eadf9f69319e intended to do
but managed to bungle by using >= instead of >.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
msg/Pipe: do not hold pipe_lock for verify_authorizer()

We shouldn't hold the pipe_lock while doing the ms_verify_authorizer
upcalls.

Fix by unlocking a bit earlier, and verifying our state is still correct
in the failure path.

This regression was introduced by ecab4bb9513385bd765cca23e4e2fadb7ac4bac2.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
FileStore: add global replay guard for split, collection_rename

In the event of a split or collection rename, we need to ensure that
we don't replay any operations on objects within those collections
prior to that point.  Thus, we mark a global replay guard on the
collection after doing a syncfs and make sure to check that in
_check_replay_guard() for all object operations.

Fixes: #5154
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
mds: tracedn should be NULL for LOOKUPINO/LOOKUPHASH reply

Fixes: #5658
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>