osd: make scrub chunk size tunable

It was hard-coded at 5.  Make it range from 5-15 by default, for now.

We should still keep this smallish since this range is locked for the
duration of the scrub on this chunk.

Signed-off-by: Sage Weil <sage@inktank.com>
unit tests for PGLog::merge_log

The tests covers 100% of the LOC of merge_log. It is broken down
in 7 cases to enumerate all the situations it must address. Each case
is isolated in a independant code block where the conditions are
reproduced. Where possible and sensible to read, a code block covers
as much lines as possible. For instance:

  The log entry (1,3) deletes the object x9 but the olog entry (2,3)
  modifies it and is authoritative : the log entry (1,3) is divergent.

is the only test case covering a dozen "if" statements and half a
dozen "while/for" loops. It covers all the lines but it would be
useful to create others scenarii in the future.

Each test is made of a comment describing the test case, the
definition of the data structures to create the desired conditons, a
sequence of EXPECT_* checking that they are met, a single call to
merge_log and another sequence of EXPECT_* ( ordered to be easy to
compare with the first sequence ) checking all the desired side
effects.

The TestPGLog.cc file was untabified to improve the display of ascii
art when it is output as part of a diff.

http://tracker.ceph.com/issues/5213 refs #5213

Signed-off-by: Loic Dachary <loic@dachary.org>
unit tests for PGLog::rewind_divergent_log

The tests covers 100% of the LOC of rewind_divergent_log. There are
three situations :

 * throw an assert because the data is inconsistent

 * special case when the entire logs is divergent

 * regular workflow where all divergent entries are run to
   merge_old_entry

http://tracker.ceph.com/issues/5213 refs #5213

Signed-off-by: Loic Dachary <loic@dachary.org>
Merge pull request #350 from ceph/wip-osd-scrub-chunk

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #349 from dachary/wip-5213

unit tests for PGLog::merge_log

Reviewed-by: Sam Just <sam.just@inktank.com>
mon: send "osd create" output to stdout; tests rely on it

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Objecter: fail osd_command if OSD is down

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
OSD: create collection in handle_pg_create before _create_lock_pg

Fixes: #5270
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ceph: --keyring must be passed to parse_argv, which means not argparse

If argparse gets its hands on it, it's not available for parse_argv()
and is therefore ignored.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
CrushWrapper: dump tunables along with crush map

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Merge git://github.com/ceph/ceph