rgw_rados.cc: fix invalid iterator comparison

The iterator should be compared against the end() function of
the same iter() from region_conn_map.

CID 1058791 (#1 of 1): Invalid iterator comparison (MISMATCHED_ITERATOR)
  mismatched_comparison: Comparing "iter" from "this->region_conn_map" to
  "this->zone_conn_map.end()" from "this->zone_conn_map".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
PG: set !flushed in Reset()

Otherwise, we might serve a pull before we start_flush in the
ReplicaActive constructor.

Fixes: #5799
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
qa/workunits/cephtool/test_daemon.sh: we should error on bad command

See #5872.

Signed-off-by: Sage Weil <sage@inktank.com>
Fix "too few args validate"

Check that number of validated arguments matches the number of required
arguments in the signature.  Also, sort all possible matches by
length of signature.  This way "ceph osd crush set" and
"ceph osd crush set <args>" can work while still insisting that
extra args or too few args are errors.

Also, restructure and factor out some of the work of validate() to make
its inner loop smaller and hopefully more comprehensible.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ceph_argparse.py: add stderr note if nonrequired param is invalid

If we run across a user-supplied parameter that doesn't validate against
a non-required descriptor, it may be that it's a valid entry for a later
descriptor...or it may be that it's supposed to match.  We can't really tell.
A possible heuristic would be to call it invalid-for-sure if we're at the
end of the descriptor list, but that's not very generic.

Warn about it and try to drive on anyway.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
cephtool/test.sh: add a few tests for invalid command args

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ceph.in, ceph_rest_api.py: import only used syms from ceph_argparse.py

This makes pyflakes/pylint happier and is better practice in general

Signed-off-by: Dan Mick <dan.mick@inktank.com>
cephtool/test.sh, rest/test.py: add tell command tests

Also add HTTP method to test.py output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
rgw_admin: flush replicalog entries

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rgw: only log (as in ops logging) certain operations

Fixes: #5875
ops logging should (at this point) should only include object
store related operations.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge branch 'wip-python-cleanup' into next

Reviewed-by: Sage Weil <sage@inktank.com>
mon/PGMonitor: add 'pg dump pgs_brief' subcommand

It is useful to map OSDs to PGs and vice-versa; pg dump gives that
information, but gives a lot of other stuff.  This is the same dump
as pg dump pgs, but omitting everything except pgid, state, and
osd up and acting sets.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
qa/workunits/cephtool/test.sh: add tests for 'pg dump ...'

Signed-off-by: Sage Weil <sage@inktank.com>
mon, osd: Clean up "flush(stringstream); bl.append(stringstream.str())

Also: One redundant flush in AuthMonitor, two in PGMonitor, and
a ds << that should have been conditional in Monitor.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
mon, osd: Clean up "flush(stringstream)" continued

Missing files in last commit; sorry!

Signed-off-by: Dan Mick <dan.mick@inktank.com>
OpRequest: don't warn as quickly for slow recovery ops

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: also suspend timeout while grabbing recovery_tp lock

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: ping TPHandle during scan_range

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: ping tphandle between pushes

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD: only start osd_recovery_max_single_start at once

Signed-off-by: Samuel Just <sam.just@inktank.com>