Commit Graph

38077 Commits

Author SHA1 Message Date
Sage Weil
a25429c9bc osd: clean up use of hex for digests
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-22 07:27:10 -08:00
Sage Weil
9c96fbb68d osd/ECBackend: use correct seed for (empty) omap digest
This will be 0 on mixed OSD version PGs, -1 on current PGs.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-22 07:12:44 -08:00
Sage Weil
2bfcf74d76 Merge branch 'wip-10409-removed-object' of git://github.com/dachary/ceph 2014-12-22 06:58:19 -08:00
Sage Weil
20a4c57c4b Merge remote-tracking branch 'gh/next'
Conflicts:
	PendingReleaseNotes
2014-12-22 06:51:14 -08:00
Sage Weil
4047f2ddef Merge pull request #3230 from ceph/wip-pg-stat
mon/PGMap: restructure 'pg stat' formatted output

Reviewed-by: John Spray <jspray@redhat.com>
2014-12-22 06:46:21 -08:00
Sage Weil
7f9c03d1bf mon/PGMap: restructure 'pg stat' formatted output
The + character, which appears in state names, is not a valid XML token.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-22 06:41:25 -08:00
Sage Weil
97c8156916 Merge pull request #3235 from dachary/wip-10410-port-7110
tests: use port 7111 for osd-copy-from.sh

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-22 06:39:20 -08:00
Sage Weil
864509ff5f Merge pull request #3234 from majianpeng/bug-fix
objectstore: add fadvise_flags operations in ObjectStore::Transaction::append func.

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-22 06:38:30 -08:00
Lei Dong
e89bafb550 remove unmatched op code comparasion
Signed-off-by: Dong Lei <leidong@yahoo-inc.com>
2014-12-22 21:33:34 +08:00
Loic Dachary
4bb6e29054 tests: use port 7111 for osd-copy-from.sh
Because port 7110 is already used by mkfs.sh

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-22 14:20:58 +01:00
Loic Dachary
6f8aad0514 tests: recovery of a lost object in erasure coded pools
http://tracker.ceph.com/issues/10409 Refs: #10409

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-22 13:56:24 +01:00
Jianpeng Ma
f4da356e68 objectstore: add fadvise_flags operations in
ObjectStore::Transaction::append func.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
2014-12-22 20:50:50 +08:00
Loic Dachary
992e7eacf4 tests: remove spurious lines from osd-scrub-repair.sh
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-22 13:42:27 +01:00
Sage Weil
3e6195bf0a Merge pull request #3228 from dachary/wip-10401-docker-install-deps
tests: oneliner to run make check in a container

Reviewed-by: Sage Weil <sage@redhat.com>
2014-12-21 15:51:34 -08:00
Loic Dachary
abd3523032 Merge pull request #3231 from ceph/wip-mon-health
mon: make 'ceph -s' show pg state counts in reverse descending order

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2014-12-22 00:35:44 +01:00
Loic Dachary
6ce1469cce tests: reduce centos docker intermediate steps
Collapse multiple RUN statements related to systemd into a single line
to reduce the number of steps that are preserved by docker.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 18:12:01 +01:00
Loic Dachary
b15bd60c4e tests: add docker-test.sh --ref giant|firefly etc.
Add the --ref option to chose the git ref to which the working tree must
be reset instead of HEAD.

   test/docker-test.sh --ref giant make

is equivalent to

   test/docker-test.sh bash -c 'git reset --hard giant ; make'

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
f0805957a2 tests: avoid bash == --shell confusion in docker-test-helper.sh
Do not force interactive mode when the bash script is specified by the
user because it should be usable to run a small script instead of
starting an interactive shell session.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
4a1c3b261a tests: add xmlstarlet in containers
It can be removed once https://github.com/ceph/ceph/pull/3228 is merged
and xmlstarlet is found in ceph.spec.in and debian/control.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
2d0d388162 tests: helpers to run make check in containers
Add scripts that run make check in a container for a given operating
system version. They are a little more than oneliners and serve two
purposes:

  * help new developers who do not have to figure out which options
    should be used

  * run make check in containers in parallel with make -j2

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
46c83d9528 tests: run-make-check.sh arguments are passed to configure
All run-make-check.sh arguments are transparently given to the configure
command. For instance:

    run-make-check.sh --enable-root-make-check

implies

    ./configure --enable-root-make-check

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
94abadbd80 tests: replace --enable-docker with --enable-root-make-check
The --enable-docker logic was that each test that needs privileges to
run uses a container to do so. The problem with this approach and
make -j8 check is that such tests compete for a single container.

The --enable-root-make-check activates tests that require privileges and
assume it is ok to use sudo to acquire privileges. The decision to run
in a container is then taken by the caller who will run something like:

   docker-tests.sh ./configure --enable-root-make-check
   docker-tests.sh make -j8 check

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:53:00 +01:00
Loic Dachary
7b68f70a2e tests: docker-test.sh commands are relative to git root
Instead of being in the src directory. Forcing the working directory to
src is convenient to run unittests individually without the need to
change directory, but it is confusing to the user.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
812570e841 tests: deprecate docker-test.sh --compile option
It is redundant with the run-make-check.sh script and imposes additional
limitations.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
621813866a tests: enable password-less sudo in containers
If compilation is run with ./configuire --enable-root-make-check, sudo
is expected to work without human interaction.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
19b6de3eee tests: ceph.spec.in or debian/control rebuild docker images
If any of the files in test/$os_type is newer than the creation date of
a docker image, the image is removed and rebuilt from scratch. For
instance, when a package is added to debian/control, the debian based
images are rebuilt.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
d8f84d15db tests: docker images must use install-deps.sh
The dockerfiles must run install-deps.sh instead of duplicating the
package list that is found in ceph.spec.in and debian/control.

A directory is created for each os_type and provided as a context for
docker build to use. The former $os_type.dockerfile is moved into
$os_type/Dockerfile.in (the .in as a reminder that it will be variable
substituted).

http://tracker.ceph.com/issues/10401 Fixes: #10401

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
80f20f8ed3 tests: run-make-check.sh install jq
jq is useful to parse json from the command line. It is however not
packaged for all supported distributions (precise has it in the backport
repository which is usually not active) and cannot be conveniently added
to debian/control because it targets all distributions and has no
conditionals.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Loic Dachary
2de2c4b035 install-deps.sh: do not require sudo when root
If the user is root, do not use sudo. The sudo package is not installed
by default on centos by default and when building from script it may be
that root is running install-deps.sh on a freshly install distribution.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2014-12-21 17:52:18 +01:00
Sage Weil
ee006bb11d Merge pull request #3134 from ceph/wip-9059-checksums
osd: record and validate whole-object checksums during deep scrub

Reviewed-by: Samuel Just <sjust@redhat.com>
2014-12-21 08:06:44 -08:00
Sage Weil
e99da68840 mon: make 'ceph -s' show pg state counts in reverse descending order
Because these are in an unordered_map we print this is random order.
Instead sort descending by count.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-21 07:43:57 -08:00
Sage Weil
9c8827a5bd osd/ReplicatedPG: initialize new_backfill in ctor
*** CID 1260213:  Uninitialized scalar field  (UNINIT_CTOR)
/osd/ReplicatedPG.cc: 1242 in ReplicatedPG::ReplicatedPG(OSDService *,
std::tr1::shared_ptr<const OSDMap>, const PGPool &, spg_t)()
1236       snap_trimmer_machine(this)
1237     {
1238       missing_loc.set_backend_predicates(
1239         pgbackend->get_is_readable_predicate(),
1240         pgbackend->get_is_recoverable_predicate());
1241       snap_trimmer_machine.initiate();
>>>     CID 1260213:  Uninitialized scalar field  (UNINIT_CTOR)
>>>     Non-static class member "new_backfill" is not initialized in this
constructor nor in any functions that it calls.
1242     }
1243
1244     void ReplicatedPG::get_src_oloc(const object_t& oid, const
object_locator_t& oloc, object_locator_t& src_oloc)
1245     {
1246       src_oloc = oloc;
1247       if (oloc.key.empty())

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-21 07:27:22 -08:00
Sage Weil
30678f6daf librados: watch_flush() on shutdown
Users can easily forget this. It makes shutdown potentially block, but if
they have racing callbacks they get what they ask for.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 12:12:33 -08:00
Sage Weil
4ebd4b4280 librados: add rados_watch_flush() call
Add a call so that callers can make sure all queued callbacks have
completed before shutting down the ioctx.  This avoids a segv triggered
by the LibRadosWatchNotifyPPTests/LibRadosWatchNotifyPP.WatchNotify2Timeout/1
test due to the ioctx being destroyed when the in-progress callback
does a notify_ack.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 12:12:33 -08:00
Sage Weil
218de829b1 osd: scrub: wait for digest updates to apply before next scrub chunk
Wait for any digest updates to apply before we scrub the next chunk.  This
bounds the number of repops we initiate by the size of the scrub chunk, and
it generally nicer to the cluster.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:06 -08:00
Sage Weil
1646d17026 osd: change omap data encoding in object_copy_data_t
Pass the omap data in the struct as an opaque (encoded) bufferlist.  This
avoids a decode into an STL map, simplifying the crc calculation.  The
win isn't huge (yet) because we still turn it into a map to pass it down
to the ObjectStore method, but that too will change in time.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:06 -08:00
Sage Weil
925f572793 test/osd/osd-copy-from: simple test of copy-from and error injection
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:05 -08:00
Sage Weil
6d80078a38 rados: use copy_from for rados cp (and cppool) command
A hammer CLI won't be able to run against a pre-firefly OSD, but I don't
think we care.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:05 -08:00
Sage Weil
5d2d839dd9 osd: add copyfrom error injection
Unfortunately it's nontrivial to inject this from the usual
ceph_test_rados_api_* tests which need to run despite thrashing.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:04 -08:00
Sage Weil
f8c1d40169 osd: pass and verify data+omap digest on copyfrom
Two things here:

 1- Pass the original digest from the source across the wire, if it is
    present.
 2- Calculate a new digest as we receive it, and record that.

If there is a mismatch, we currently crash; need to turn this into an
EIO, most likely.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:04 -08:00
Sage Weil
75b2bc2823 osd: EIO if a full-object read produces a bad digest
Add a tunable to control this.  Returning an EIO instead of garbled data
may not be the best approach in all environments.

Eventually we want to do something better here, like read from a replica
instead.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:04 -08:00
Sage Weil
55bf020b57 osd: scrub: set a min age before we update whole-object digest
If an object is being actively updated, the whole-object digest will
quickly be invalidated.  On deep scrub, only record that digest if the
object is a few hours old.  Otherwise, we are wasting an IO.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:03 -08:00
Sage Weil
28d4dd89c4 osd: scrub: record whole-object digest on scrub
If we do not have a whole-object digest, record one after a deep scrub.

Note that we make no particular attempt to avoid this on frequently
changing objects where the digest will quickly be invalidated.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:03 -08:00
Sage Weil
6feb4a1710 osd: scrub: complain about bad digest in final pass auth check
This will only trigger if we choose an auth that is known bad, but that
currently can happen, so compalin here too.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:02 -08:00
Sage Weil
85f677a4aa osd: scrub: be explicit about whether bad digest is known bad
The digest may just disagree with our best guess 'auth' shard, or it may
also disagree with the recorded oi digest.  Clarify which.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:02 -08:00
Sage Weil
14f3c26a1f osd: scrub: disqualify shards with digests that disagree with oi digest
The auth may or may not know that the digest is truly bad.  Note that we
can only relate scrub digests to those in oi if the scrub used a seed of
-1; older OSDs use 0.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:01 -08:00
Sage Weil
cf3b04764d osd: scrub: share auth oi with caller and be_compare_scrub_objects
Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:01 -08:00
Sage Weil
74bd8708df osd: move scrub no good auth check out of helper
This helps call out that this is an exceptional case and simplifies the
helper a bit.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:00 -08:00
Sage Weil
9c3afccbf1 osd: remove more (most? all?) of classic scrub
Hopefully this is everything

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:30:00 -08:00
Sage Weil
7d73f41f0d osd: use -1 for deep scrub digest seed on new OSDs
0 is a weak initial value for a CRC since it doesn't change with a sequence
of 0 bytes (which are relatively common).  -1 is better.  Use -1 when
everyone in the acting set supports it.

Signed-off-by: Sage Weil <sage@redhat.com>
2014-12-20 07:28:52 -08:00